Skip to content

fix reference marking in for-in loops#1535

Merged
alexlamsl merged 1 commit intomishoo:masterfrom
alexlamsl:issue-1533
Mar 2, 2017
Merged

fix reference marking in for-in loops#1535
alexlamsl merged 1 commit intomishoo:masterfrom
alexlamsl:issue-1533

Conversation

@alexlamsl
Copy link
Copy Markdown
Collaborator

fixes #1533

/cc @kzc

@alexlamsl alexlamsl merged commit fe9227a into mishoo:master Mar 2, 2017
@alexlamsl alexlamsl deleted the issue-1533 branch March 2, 2017 16:56
node.init.definition().fixed = false;
var d = node.init.definition();
d.references.push(node.init);
d.fixed = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's because with for (a in obj) {...}, node.init is just AST_SymbolRef which is a.

In theory I could extend isModified() to cover for-in loops, but putting it here is easier given the structure of the code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the explanation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for all the testing and hand-holding 😉

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.8.4: more regressions in for loops

2 participants