Fix regressions - #1586
Merged
Merged
Conversation
* Add more nodes * Fix dropped declarations in loops where the loop variable is not used * Fix side-effect detection for break-statements
This was referenced Aug 28, 2017
Contributor
Contributor
|
Wondering if this also has a positive effect on #1588 |
Member
Author
Member
Author
|
Will resolve #1588 |
Member
Author
|
Until this is merged, you should be able to install rollup from this pull request via "rollup": "rollup/rollup#pull/1586/head"in your package.json |
Contributor
|
released as 0.49.1 — thank you! |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This resolves #1584 and #1585 by introducing a new options parameter object describing the current execution path to
Node.hasEffects()and similar functions.For now, there are two options:
inNestedFunctionCall = false/truetells us if we are looking at effects of statements inside a nested function call. If we are inside a function, then all return statements should be kept; however, they should not count as effects for nested function callsinNestedBreakableStatement = false/truetells us if we are looking at effects inside a nested loop or switch statement (i.e. something that can contain BreakStatements). If we are inside e.g. a switch statement, then break statements should never be omitted; however, they should not count as effects for nested switch statements/loopsIt should also test for and fix #1587.