mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 13:02:50 -05:00
A .js script now reads async function declarations and expressions, async arrow functions and async methods in object literals, as ECMA-262 2017 section 25.5 defines them. A call returns a Promise that the function's return resolves and an uncaught exception rejects. await suspends the function's frame until its operand settles; a promise job resumes it with the value, or throws the rejection at the await, so try, catch and finally work around it. - Options::es2017 turns the syntax on and implies Options::es2015; script.run sets it for .js files. .jsx scripts and source strings keep async and await as plain names. - A suspended frame is a heap object the collector traces, reached only from its promise reactions, so a function waiting on a promise that nothing can settle is freed. Each resume is a job and takes fuel. - AsyncFunction and its prototype exist without a global binding; async functions are not constructors and have no prototype property. - The test262 runner reads the async-function, await and async-arrow folders and counts runs with and without the option; an async test with a runtime negative now has to throw.