tc39 / proposal-array-from-async

Draft specification for a proposed Array.fromAsync method in JavaScript.
http://tc39.es/proposal-array-from-async/
BSD 3-Clause "New" or "Revised" License
177 stars 13 forks source link

Spec: AsyncFunctionStart does not accept closure argument #24

Closed js-choi closed 2 years ago

js-choi commented 2 years ago

Step 4 of the specification currently says:

Perform AsyncFunctionStart(promiseCapability, fromAsyncClosure).

This is an error. AsyncFunctionStart, which in turn calls AsyncBlockStart, expects its second argument to be a Parse Node.

We might want first to call CreateBuiltinFunction on fromAsyncClosure or something.

This issue was discovered by Aditi Singh of Igalia.

bakkot commented 2 years ago

You can change AsyncBlockStart to accept either a parse node or an Abstract Closure with no parameters. That's what GeneratorStart does.