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

Handle line-comments when removing line-breaks to prevent ASI #3762

Merged
merged 1 commit into from Sep 4, 2020

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

Description

When removing line-breaks to prevent automatic semicolon insertion in certain situation, it needs to be taken into account that a line comment before the end of the line can lead to broken or incomplete code. This is fixed here by removing the entire comment in such a situation.

@rollup-bot
Copy link
Collaborator

Thank you for your contribution! ❤️

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

npm install rollup/rollup#gh-3761-ASI-comments

or load it into the REPL:
https://rollupjs.org/repl/?circleci=12849

@codecov
Copy link

codecov bot commented Sep 4, 2020

Codecov Report

Merging #3762 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3762      +/-   ##
==========================================
- Coverage   97.02%   97.02%   -0.01%     
==========================================
  Files         185      185              
  Lines        6461     6460       -1     
  Branches     1868     1868              
==========================================
- Hits         6269     6268       -1     
  Misses        101      101              
  Partials       91       91              
Impacted Files Coverage Δ
src/utils/renderHelpers.ts 100.00% <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 581c1fc...85ec72f. Read the comment docs.

@lukastaegert lukastaegert merged commit 4db9f89 into master Sep 4, 2020
@lukastaegert lukastaegert deleted the gh-3761-ASI-comments branch September 4, 2020 05:14
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.

LogicalExpression tree shaking optimisation breaks with comment
2 participants