Skip to content
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

await an expression that ends with at least two semicolons returns undefined #39932

Closed
Mesteery opened this issue Aug 29, 2021 · 1 comment
Closed
Labels
repl Issues and PRs related to the REPL subsystem.

Comments

@Mesteery
Copy link
Contributor

Version

16.8.0

Platform

No response

Subsystem

repl

What steps will reproduce the bug?

> await 1;;

How often does it reproduce? Is there a required condition?

with the top level await, and at least 2 semicolons.

What is the expected behavior?

> await 1;;
1

What do you see instead?

> await 1;;
undefined

Additional information

No response

@Mesteery Mesteery added repl Issues and PRs related to the REPL subsystem. confirmed-bug Issues with confirmed bugs. labels Aug 29, 2021
@Mesteery Mesteery changed the title undefined is returned when an expression ends with more than one ; with await await an expression that ends with at least two ; returns undefined Aug 29, 2021
@Mesteery Mesteery changed the title await an expression that ends with at least two ; returns undefined await an expression that ends with at least two semicolons returns undefined Aug 29, 2021
@Mesteery
Copy link
Contributor Author

Mesteery commented Aug 29, 2021

This seems normal, acorn returns an EmptyStatement for the extra(s) ;. I don't know if we should take the last ExpressionStatement before EmptyStatement(s) or keep this behavior. Knowing that in Firefox it returns the same result than Node.js (undefined) and in Chromium 1.

@Mesteery Mesteery removed the confirmed-bug Issues with confirmed bugs. label Aug 29, 2021
Mesteery added a commit to Mesteery/node that referenced this issue Sep 23, 2021
Mesteery added a commit to Mesteery/node that referenced this issue Sep 23, 2021
@targos targos closed this as completed in 92ecd9f Sep 27, 2021
targos pushed a commit that referenced this issue Oct 4, 2021
Fixes: #39932

PR-URL: #40194
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant