Skip to content

Disallow let in let/const declaration regardless of target #5898

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

Merged
merged 4 commits into from
Dec 4, 2015
Merged

Conversation

yuit
Copy link
Contributor

@yuit yuit commented Dec 2, 2015

fix #3475

// var let = 10;
// for (let of [1,2,3]) {} // this is invalid ES6 syntax
// for (let in [1,2,3]) {} // this is invalid ES6 syntax
if (firstDeclaration) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making this a check on variableList.declaration.length > 0. @vladima might be able to weigh in on if this sort of thing causes de-opts.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 3, 2015

LGTM

yuit added a commit that referenced this pull request Dec 4, 2015
Disallow let in let/const declaration regardless of target
@yuit yuit merged commit 3a4ac33 into master Dec 4, 2015
@yuit yuit deleted the fix3475_let branch December 4, 2015 06:27
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'let' should not be allowed to be bound as a variable in a for-of loop or let/const decl
4 participants