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 bug? #33798
Comments
This also manifests when you do The direct repl behavior seems limited to 12+. |
I've been informed that in fact this is correct; |
Also:
|
This is not a bug. |
Nods, |
REPL is an expression context, the input is actually |
We handle REPL input as expression context as @devsnek pointed out. See Lines 355 to 358 in 651088c
This also applies to e.g., { b: 1 }.b .
|
As @ljharb highlighted, on node |
As @devsnek and @BridgeAR pointed out, this is not a bug, but intentional – the REPL prefers to evaluate as expressions before evaluating as statements. So the current one is the expected behavior, and the pre-v12.x one is considered the buggy one. I’ll close this as I don’t think there’s anything we can do here. |
hmm - i don't see this REPL change listed in the blog post: https://nodejs.org/en/blog/release/v12.0.0/ Clearly it's the right fix to make, and I assume its omission is an oversight - could someone link me to the PR that changed it? |
Was there a PR for this? @ljharb :D |
In the REPL, on
12+
version, I am seeing the below.^ This should be
0
The text was updated successfully, but these errors were encountered: