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 stuck in temporal deadzone #23052

Closed
psykzz opened this issue Sep 24, 2018 · 1 comment
Closed

Variable stuck in temporal deadzone #23052

psykzz opened this issue Sep 24, 2018 · 1 comment

Comments

@psykzz
Copy link

psykzz commented Sep 24, 2018

  • Version: v8.11.3
  • Platform: Mac OSX 10.13.4
  • Subsystem: unknown

If during assignment of a let you assign a syntax error, your variable will become un-useable.
For an example let a = Ahhhh.

> let a = Ahhh
ReferenceError: Ahhh is not defined
> a
ReferenceError: a is not defined
> a = 5
ReferenceError: a is not defined
> typeof a
ReferenceError: a is not defined
> let a = 10
SyntaxError: Identifier 'a' has already been declared
>

I suspect this is related to the temporal dead zone as described at developer.mozilla.org/let#Temporal_Dead_Zone.

@psykzz psykzz changed the title Varible stuck in temporal deadzone Variable stuck in temporal deadzone Sep 24, 2018
@devsnek
Copy link
Member

devsnek commented Sep 24, 2018

Duplicate of #13919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants