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

Revisit vars after splitting when processing CommonJS Modules #2596

Closed

Conversation

ChadKillingsworth
Copy link
Collaborator

Fixes #2593

Because rewriting commonjs modules is a post-order traversal, we need to specifically revisit vars after splitting multiple declarations apart.

@anmonteiro
Copy link
Contributor

Tested this patch and fixes my previously failing tests 👍

… split var declarations and then re-visit all the new nodes.
@dimvar
Copy link
Contributor

dimvar commented Aug 2, 2017

LGTM. I'll submit this internally.

@dimvar dimvar self-assigned this Aug 2, 2017
@dimvar dimvar closed this in afecc10 Aug 2, 2017
@ChadKillingsworth ChadKillingsworth deleted the commonjs-split-vars branch August 3, 2017 16:39
@dimvar
Copy link
Contributor

dimvar commented Aug 3, 2017

FYI, this broke an internal project and was rolled back. I'll try to fix it and roll it forward tomorrow.

dimvar pushed a commit that referenced this pull request Aug 3, 2017
*** Original change description ***

Because ProcessCommonJSModules has a post-order traversal, we have to split var declarations and then re-visit all the new nodes.

Closes #2596

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164151398
@dimvar
Copy link
Contributor

dimvar commented Aug 4, 2017

The fix was to avoid splitting a VAR inside a FOR header. Hope to roll this forward and push externally today.

dimvar added a commit that referenced this pull request Aug 4, 2017
Fix: Back-off the VAR split if the parent is a FOR.

*** Original change description ***

Because ProcessCommonJSModules has a post-order traversal, we have to split var declarations and then re-visit all the new nodes.

Closes #2596

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164281163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants