-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
REPL - after failed assignment identifier cannot be reused #3704
Comments
@SamuelMarks |
Oh right, forgot about that. When I was coding Node years ago I now remember setting |
@SamuelMarks No problem :-) I created a PR (#3729) with doc changes regarding the same. Please feel free to review it. |
When users assign a value to `_` in REPL, it is prone to unexpected results or messing up with REPL's internals. For example, nodejs#3704. This patch issues a warning about the same.
As `_` is not defined in REPL's context, when it is defined as `const`, it breaks REPL, as it tries to store the result of the last evaluated expression in `_`. This patch makes sure that `_` is pre-defined in REPL's context, so that if users define it again, they will get error. Refer: nodejs#3729 Refer: nodejs#3704
If the `_` is redefined as `const` in REPL, it will break the REPL, as REPL will store the result of the last evaluated expression in `_`. This patch has a test to make sure that the REPL doesn't allow redefining `_` as `const`, also still assiging values to `_` is permitted. Refer: nodejs#3729 Refer: nodejs#3704
When users assign a value to `_` in REPL, it is prone to unexpected results or messing up with REPL's internals. For example, nodejs#3704. This patch issues a warning about the same.
I am running Node 4.2.1 x64 on Windows 8.1 x64.
The text was updated successfully, but these errors were encountered: