-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Closed
Labels
promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.
Description
- Version: v10.9.0
- Platform: Windows 10 Pro 10.0.17134 x64
- Subsystem: REPL
The REPL is working great with regular await, but doesn't seem to be able to handle the new for await of syntax that was introduced as part of the async-iteration spec.
for await of works when wrapping the call with an async function, it only fails if used at the top level.
This fails:
$ node --experimental-repl-await
> for await (let i of [1,2,3]) console.log(i)
for await (let i of [1,2,3]) console.log(i)
^^^^^
SyntaxError: Unexpected reserved wordThis works:
> (async () => { for await(let i of [1,2,3]) console.log(i) })()
Promise {
<pending>,
domain: ...etc }
> 1
2
3Metadata
Metadata
Assignees
Labels
promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.replIssues and PRs related to the REPL subsystem.Issues and PRs related to the REPL subsystem.