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

for (let x of x) doesn't work in next+1 branch #2203

Closed
andy-hanson opened this issue Jul 18, 2015 · 4 comments
Closed

for (let x of x) doesn't work in next+1 branch #2203

andy-hanson opened this issue Jul 18, 2015 · 4 comments
Labels
invalid Issues and PRs that are invalid. v8 engine Issues and PRs related to the V8 dependency.

Comments

@andy-hanson
Copy link

This code:

let x = [ 1, 2, 3 ]
for (let x of x)
    console.log(x)

works in iojs 2.4.0, but not in the branch next+1 (commit a6b6295).
Now it fails with:

ReferenceError: x is not defined
    at Object.<anonymous> (/home/andy/programming/mason3/TEST/class.js:4:15)
    at Module._compile (module.js:432:26)
    at Object.Module._extensions..js (module.js:450:10)
    at Module.load (module.js:353:32)
    at Function.Module._load (module.js:308:12)
    at Function.Module.runMain (module.js:473:10)
    at startup (node.js:117:18)
    at node.js:947:3
@Fishrock123 Fishrock123 added the v8 engine Issues and PRs related to the V8 dependency. label Jul 18, 2015
@ChALkeR
Copy link
Member

ChALkeR commented Jul 19, 2015

I suppose that's v8, and that looks like a fixed version of let implementation, not a bug.

http://www.ecma-international.org/ecma-262/6.0/#sec-let-and-const-declarations
http://jsrocks.org/2015/01/temporal-dead-zone-tdz-demystified/

@ChALkeR ChALkeR closed this as completed Jul 19, 2015
@ChALkeR ChALkeR added the invalid Issues and PRs that are invalid. label Jul 19, 2015
@ChALkeR
Copy link
Member

ChALkeR commented Jul 19, 2015

It was wrong before (in iojs 2.4.0, due to v8), now it's good (was fixed in the new v8 version that got into next+1).

@ChALkeR
Copy link
Member

ChALkeR commented Jul 19, 2015

Btw, it's nice that that was finally fixed in v8 =).
Relevant mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1069480

@ChALkeR
Copy link
Member

ChALkeR commented Aug 15, 2015

As a note: this is technically a backwards-incompatible change on the v8 side.
But evertything is perfectly fine as long as the update to v8 4.5 happens in a major release of node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

3 participants