Files
scriptc/tests/corpus/3109-destructuring-unknown-defaults.js
Chris Tate 04aa42354c Support static for-await over synchronous arrays (#498)
* Support synchronous arrays in for-await loops

Drive array values through async-from-sync timing, including promise values and early iterator close. Handle defaulted union destructuring into checked-dynamic bindings and refuse void callback parameters before native code generation. Add differential coverage and pinned async Test262 regressions with original-source completion checks.

* Fix Error subclass C calls and diagnostics snapshot
2026-09-27 19:00:17 -05:00

13 lines
374 B
JavaScript

async function main() {
for await (const [value = 10, nullValue = 11, hole = 12, explicit = 13, missing = 14] of [[2, null, , undefined]]) {
console.log(value, nullValue, hole, explicit, missing);
}
const items = [[3, null, undefined], [4, 5, 6]];
for (const [first = 8, second = 9, third = 10] of items) {
console.log(first, second, third);
}
}
main();