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

Do not include unused return expressions #4573

Merged
merged 3 commits into from Jul 15, 2022

Conversation

lukastaegert
Copy link
Member

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 #4542

Description

When a function contains a return expression after an error, the argument of this return would be included even though it is unused in the final bundle. This is fixed here.

@github-actions
Copy link

github-actions bot commented Jul 15, 2022

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#gh-4542-non-included-return-expressions

or load it into the REPL:
https://rollupjs.org/repl/?pr=4573

@codecov
Copy link

codecov bot commented Jul 15, 2022

Codecov Report

Merging #4573 (e298b29) into master (f019fae) will decrease coverage by 0.00%.
The diff coverage is n/a.

❗ Current head e298b29 differs from pull request most recent head 71f83c3. Consider uploading reports for the commit 71f83c3 to get more accurate results

@@            Coverage Diff             @@
##           master    #4573      +/-   ##
==========================================
- Coverage   98.87%   98.86%   -0.01%     
==========================================
  Files         209      209              
  Lines        7350     7344       -6     
  Branches     2100     2098       -2     
==========================================
- Hits         7267     7261       -6     
  Misses         27       27              
  Partials       56       56              
Impacted Files Coverage Δ
src/ast/nodes/CallExpression.ts 100.00% <ø> (ø)
src/ast/nodes/shared/MultiExpression.ts 100.00% <ø> (ø)

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 f019fae...71f83c3. Read the comment docs.

@lukastaegert lukastaegert force-pushed the gh-4542-non-included-return-expressions branch from bfd339f to e298b29 Compare July 15, 2022 10:07
@lukastaegert lukastaegert force-pushed the gh-4542-non-included-return-expressions branch from e298b29 to 71f83c3 Compare July 15, 2022 10:14
@lukastaegert lukastaegert merged commit 01e2461 into master Jul 15, 2022
@lukastaegert lukastaegert deleted the gh-4542-non-included-return-expressions branch July 15, 2022 10:20
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.

Rollup retains classes mentioned in fallthru after throw
1 participant