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

TDZ is not enforced within initializer of lexical declaration #2637

Closed
jugglinmike opened this Issue Aug 23, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@jugglinmike
Copy link
Member

jugglinmike commented Aug 23, 2015

The following code should produce error E056 but currently does not:

// jshint esversion: 6
let a = a;
const b = b;

See also: gh-2632

@jugglinmike jugglinmike added the ES6 label Aug 23, 2015

@lukeapage lukeapage added the P3 label Sep 6, 2015

nicolo-ribaudo added a commit to nicolo-ribaudo/jshint that referenced this issue Sep 21, 2015

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Sep 11, 2016

rwaldron added a commit that referenced this issue Oct 18, 2016

Enforce TDZ within initializer of lexical declaration (refactored) (#…
…2733)

* [[FIX]] Enforce TDZ within initializer of lexical declaration

Fixes #2637

* [[FIX]] Enforce TDZ within class heritage definition

* [[FIX]] Enforce TDZ within for in/of head

Fixes gh-2693

* [[CHORE]] Refactor var initialization tracking

Conceptually, the initialization state of a given variable is a property
of that variable. Model that relationship in the code organization by
tracking variable initialization using a dedicated property on the
representation of the variable itself. Beyond improving code clarity
(the "label" objects remain the single source of truth for the state of
each variable), this also reduces memory allocation costs (no new
objects need to be created).

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Nov 13, 2016

Enforce TDZ within initializer of lexical declaration (refactored) (j…
…shint#2733)

* [[FIX]] Enforce TDZ within initializer of lexical declaration

Fixes jshint#2637

* [[FIX]] Enforce TDZ within class heritage definition

* [[FIX]] Enforce TDZ within for in/of head

Fixes jshintgh-2693

* [[CHORE]] Refactor var initialization tracking

Conceptually, the initialization state of a given variable is a property
of that variable. Model that relationship in the code organization by
tracking variable initialization using a dedicated property on the
representation of the variable itself. Beyond improving code clarity
(the "label" objects remain the single source of truth for the state of
each variable), this also reduces memory allocation costs (no new
objects need to be created).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment