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

"SyntaxError: Identifier has already been declared" but "ReferenceError: is not defined" #32691

Closed
omerl13 opened this issue Apr 6, 2020 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. repl Issues and PRs related to the REPL subsystem.

Comments

@omerl13
Copy link

omerl13 commented Apr 6, 2020

  • Version: 13.12.0
  • Platform: Windows 10 64-bit
  • Subsystem: 1909

What steps will reproduce the bug?

Running the following:

c:\>node
Welcome to Node.js v13.12.0.
Type ".help" for more information.
> let a = b
Uncaught ReferenceError: b is not defined
> let a = 2
Uncaught SyntaxError: Identifier 'a' has already been declared
> a = 2
Uncaught ReferenceError: a is not defined

Uncaught ReferenceError: a is not defined

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

Always

What is the expected behavior?

Probably same as Chrome devtools:

let a = b
VM54:1 Uncaught ReferenceError: b is not defined
    at <anonymous>:1:9
(anonymous) @ VM54:1
a = 2
VM70:1 Uncaught ReferenceError: Cannot access 'a' before initialization
    at <anonymous>:1:3
(anonymous) @ VM70:1
let a = 2 \\ works

What do you see instead?

See "What steps will reproduce the bug?" section

Additional information

Found this similar question on SO: https://stackoverflow.com/questions/41395939/is-not-defined-and-identifier-has-already-been-declared-at-the-same-time

@addaleax addaleax added duplicate Issues and PRs that are duplicates of other issues or PRs. repl Issues and PRs related to the REPL subsystem. labels Apr 6, 2020
@devsnek
Copy link
Member

devsnek commented Apr 6, 2020

Duplicate of #8441 #8376 #8309 #16520 #14092

@devsnek devsnek closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

3 participants