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

Fix switch case not being included correctly #3178

merged 2 commits into from Oct 20, 2019


Copy link

@lukastaegert lukastaegert commented Oct 20, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #3177


This fixes a very peculiar situation where since during the first tree-shaking run, no case of a switch statement that had a default was included, the logic assumed that the control flow was broken and included no further statements after the switch, even though those would have caused the switch to have a side-effect.

Copy link

codecov bot commented Oct 20, 2019

Codecov Report

Merging #3178 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3178      +/-   ##
+ Coverage    90.2%   90.2%   +<.01%     
  Files         165     165              
  Lines        5909    5910       +1     
  Branches     1799    1800       +1     
+ Hits         5330    5331       +1     
  Misses        350     350              
  Partials      229     229
Impacted Files Coverage Δ
src/ast/nodes/SwitchStatement.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d677eb7...f64c20a. Read the comment docs.

@lukastaegert lukastaegert merged commit 06047fc into master Oct 20, 2019
7 checks passed
@lukastaegert lukastaegert deleted the switch-case-inclusion-error branch Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

Incorrect tree-shaking with switch + default
1 participant