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

DCE: Deopt impure statements in If.test #386

Merged
merged 4 commits into from Jan 25, 2017
Merged

DCE: Deopt impure statements in If.test #386

merged 4 commits into from Jan 25, 2017

Conversation

boopathi
Copy link
Member

@boopathi boopathi commented Jan 22, 2017

TODO:

  • Test case for impure statements
  • Preset test cases with other plugins ?

Note:

This moves IfStatement from program.traverse in DCE to DCEPlugin.visitor.

foo();
}
`);
expect(transform(source)).toBe(source);
Copy link
Member Author

Choose a reason for hiding this comment

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

this can be improved.

+ (Fix #385)
+ Add isPure check to IfStatement visitor in DCE
+ Move IfStatement visitor from Single Pass program.exit to DCEPlugin.visitor - so that it executes for all IfStatements as babel traverse happens and NOT during programPath.traverse. This eliminates the need for a second pass for things like the one mentioned in #385.
@boopathi
Copy link
Member Author

@kangax the failing tests are - getting </script instead of <\\\\/script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tag: Bug Fix Pull Request fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants