Skip to content

node v4 fails to reassignes const in for-of loops properly - #4309

Merged
sokra merged 1 commit into
webpack:masterfrom
timse:fix-node-4-for-of-issue
Feb 20, 2017
Merged

sokra merged 1 commit into
webpack:masterfrom
timse:fix-node-4-for-of-issue

Conversation

@timse

@timse timse commented Feb 19, 2017

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

bugfix

Did you add tests for your changes?

N/A

If relevant, link to documentation update:

N/A

Summary

In node v4 a for(const foo of bar) loop is not correctly evaluated:

Actual:

> for(const x of [1,2,3]) {console.log(x)}
1
1
1
undefined

expected:

> for(let x of [1,2,3]) {console.log(x)}
1
2
3

Does this PR introduce a breaking change?

No

@sokra
sokra merged commit f8c3e63 into webpack:master Feb 20, 2017
@sokra

sokra commented Feb 20, 2017

Copy link
Copy Markdown
Member

Thanks

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

Successfully merging this pull request may close these issues.

2 participants