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

Correctly simplify assignments with parentheses #3926

Merged
merged 1 commit into from Jan 16, 2021

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

Description

This fixes an issue where Rollup would incorrectly simplify assignment right-hand-sides with parentheses. Also, this improves performance of the non-white-space detection function by using a stateful regular expression instead of a loop.

@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-3924-simplify-parenthese-assignment

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

@codecov
Copy link

codecov bot commented Jan 16, 2021

Codecov Report

Merging #3926 (4c60777) into master (d660063) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3926   +/-   ##
=======================================
  Coverage   97.08%   97.08%           
=======================================
  Files         187      187           
  Lines        6554     6556    +2     
  Branches     1911     1910    -1     
=======================================
+ Hits         6363     6365    +2     
  Misses        101      101           
  Partials       90       90           
Impacted Files Coverage Δ
src/ast/nodes/AssignmentExpression.ts 100.00% <100.00%> (ø)
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 d660063...4c60777. Read the comment docs.

@lukastaegert lukastaegert merged commit d70415f into master Jan 16, 2021
@lukastaegert lukastaegert deleted the gh-3924-simplify-parenthese-assignment branch January 16, 2021 06:18
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 2.36.* produces invalid output
2 participants