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

Variable declaration bug. #25591

Closed
dalechyn opened this issue Jan 20, 2019 · 1 comment
Closed

Variable declaration bug. #25591

dalechyn opened this issue Jan 20, 2019 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs. question Issues that look for answers. repl Issues and PRs related to the REPL subsystem.

Comments

@dalechyn
Copy link

  • Version: v8.11.2
  • Platform: Linux parrot 4.19.0-parrot1-13t-amd64 deps: update openssl to 1.0.1j #1 SMP Debian 4.19.13-1parrot1.13t (2019-01-09) x86_64 GNU/Linux
  • Subsystem: none.

Hello. I've found next bug:
If you do a constructor call with a function which has an error, and create variable with that call, that variable won't ever be accessed.

Steps to reproduce:

node
> function WrongClass() {
... thio.a = 5 // lets asume we have typo error here
... }
undefined
> a
ReferenceError: a is not defined
> let a = new WrongClass()
ReferenceError: thio is not defined
    at new WrongClass (repl:2:1)
> // Now we have an error and we are trying to redeclare a
undefined
> let a = 3
SyntaxError: Identifier 'a' has already been declared
> // Oops! Allright, lets try this
undefined
> a = 4
ReferenceError: a is not defined
> // So is it defined or not? Whaatt??
undefined

@dalechyn dalechyn changed the title Variable declare bug. Variable declaration bug. Jan 20, 2019
@BridgeAR BridgeAR added duplicate Issues and PRs that are duplicates of other issues or PRs. question Issues that look for answers. repl Issues and PRs related to the REPL subsystem. labels Jan 20, 2019
@BridgeAR
Copy link
Member

Duplicate of #22181, #8309 and many more.

It is really inconvenient that this is the case but there's little we can do to change this (maybe we should consider to work around this though as a lot of people run into this issue).

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. question Issues that look for answers. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

2 participants