mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
A script run from a .js file now has Promise as ECMA-262 11th edition section 25.6 defines it: the constructor, then, catch, finally, and Promise.resolve, reject, all, allSettled and race. .jsx scripts and scripts given as source keep the ES5.1 built-ins; a named engine gets Promise at the first .js run that names it and keeps it. - The callbacks run as jobs from one FIFO queue after the script's own code ends and before the run ends, sliced like the script, with no native recursion along a then chain. Each job takes 1 unit of fuel, so an endless chain stops at the fuel limit. - More than 1,048,576 waiting jobs end the run with a Jobs limit error. A run that fails, hits a limit or is stopped drops its waiting jobs and rolls back as before. - A promise still rejected with no handler when the run ends goes to the report's unhandledRejections (first 20) and unhandledRejectionCount, and to the Script Console with its file, line and column. - Until the language has iterators, all, allSettled and race take arrays, objects with a whole-number length and strings, and the statics always build plain Promise objects. Promise.any is not provided. cargo xtask test262 now runs the suite's built-ins/Promise tests that need only the built-ins present: 402 of 538 runs pass. Docs: docs/mcp.md, docs/target-app-parity.md.