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 isn't enforced in for in/of head #2693

Closed
nicolo-ribaudo opened this Issue Sep 22, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@nicolo-ribaudo
Copy link
Contributor

nicolo-ribaudo commented Sep 22, 2015

for (let a in a) {}

Shouldn't JSHint throw a TDZ error?

nicolo-ribaudo added a commit to nicolo-ribaudo/jshint that referenced this issue Oct 10, 2015

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

@rwaldron rwaldron closed this in 8e9d406 Oct 18, 2016

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