-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
Lexical scoping of the const
is not invalidated when use await
in REPL
#45918
Closed
Labels
doc
Issues and PRs related to the documentations.
Comments
abhishekumar-tyagi
pushed a commit
to abhishekumar-tyagi/node
that referenced
this issue
May 5, 2024
Invalidating the lexical scoping of the `const` and `let` keywords is fixed. Fixes: nodejs/node#45918
abhishekumar-tyagi
pushed a commit
to abhishekumar-tyagi/node
that referenced
this issue
May 5, 2024
Lexical scope of `const` is only invalidated when using top-level `await` in REPL. Fixes: nodejs/node#45918
dario-piotrowicz
pushed a commit
to dario-piotrowicz/node
that referenced
this issue
Mar 27, 2025
Lexical scope of `const` is only invalidated when using top-level `await` in REPL. As part of this change also add tests for the documented behavior Fixes: nodejs#45918 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Dario Piotrowicz <[email protected]> add k already decalared test case add comment
dario-piotrowicz
pushed a commit
to dario-piotrowicz/node
that referenced
this issue
Mar 28, 2025
Lexical scope of `const` is only invalidated when using top-level `await` in REPL. As part of this change also add tests for the documented behavior Fixes: nodejs#45918 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Dario Piotrowicz <[email protected]> add k already decalared test case add comment
dario-piotrowicz
added a commit
to dario-piotrowicz/node
that referenced
this issue
Mar 28, 2025
Lexical scope of `const` is only invalidated when using top-level `await` in REPL. As part of this change also add tests for the documented behavior Fixes: nodejs#45918 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Dario Piotrowicz <[email protected]>
dario-piotrowicz
added a commit
to dario-piotrowicz/node
that referenced
this issue
Mar 28, 2025
Clarify that the lexical scope of `const` is invalidated when using top-level `await` in REPL. As part of this change also add tests for the documented behavior Fixes: nodejs#45918 Co-authored-by: Antoine du Hamel <[email protected]> Co-authored-by: Dario Piotrowicz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affected URL(s)
https://github.com/nodejs/node/blob/main/doc/api/repl.md#await-keyword
Description of the problem
In document, described as below.
One known limitation of using the await keyword in the REPL is that it will invalidate the lexical scoping of the const and let keywords.
For example:
But actual result is different like below.
(1) const
(2) let
I guess limitation is fixed. So how about removing these lines(
One known blabla
, including example) from document?The text was updated successfully, but these errors were encountered: