-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for await of
syntax doesn't work with --experimental-repl-await
#23836
Comments
сс @nodejs/repl |
This is expected,
That's the exact reason why it works perfectly fine, when you wrap with Edit: Looks like repl supports top level
|
its would seem to be a bug in https://github.com/nodejs/node/blob/master/lib/internal/repl/await.js |
So the visitors don't check for a ForOfStatement with fix looks like this nodejs/repl@2003bc5 if anyone wants to take it |
@devsnek happy to handle this! |
Oh snap! Thank you so much for addressing this so quickly! 🤩 |
PR-URL: #23841 Fixes: #23836 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #23841 Fixes: #23836 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #23841 Fixes: #23836 Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: James M Snell <[email protected]>
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:
This works:
The text was updated successfully, but these errors were encountered: