Files
YourWishesandClaude Sonnet 5.5 f6b884bf7f Allow script arrays to hold any value type, add script engine tests, archive old rpg code
Remove the per-array type category so arrays can mix types like structs.
Add 13 passing and 125 expected-failure duskscript test fixtures with a
table-driven runner. Also includes the in-progress entity/physics and
archive moves from the working tree.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-14 23:25:26 -05:00

27 lines
544 B
Plaintext

async function giveFive() {
return 5;
}
async function addAsync(a, b) {
return a + b;
}
async function chain() {
var first = await giveFive();
var second = await addAsync(first, 10);
return second;
}
var value = await giveFive();
assert(value == 5);
assert(await addAsync(2, 3) == 5);
assert(await chain() == 15);
var promiseValue = giveFive();
assert(!isnull(promiseValue));
assert(await promiseValue == 5);
// Looping with awaits
var total = 0;
for(var i = 0; i < 5; i++) {
total += await addAsync(i, 1);
}
assert(total == 15);