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

Avoid conflicts with local variables named Symbol, Object, Promise #3971

merged 1 commit into from Feb 23, 2021


Copy link

@lukastaegert lukastaegert commented Feb 23, 2021

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


For various features, Rollup relies on the global variables Symbol, Object and Promise working as intended. This can break if a module declares a variable of the same name in its top-level scope. This PR fixes it by making sure these names are always treated as reserved so that local variables are renamed if necessary.

Copy link

@rollup-bot rollup-bot commented Feb 23, 2021

Thank you for your contribution! ❤️

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

npm install rollup/rollup#gh-3969_avoid_builtin_conflicts

or load it into the REPL:

Copy link

@codecov codecov bot commented Feb 23, 2021

Codecov Report

Merging #3971 (e05babf) into master (f3b1c81) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3971   +/-   ##
  Coverage   97.21%   97.21%           
  Files         191      191           
  Lines        6704     6706    +2     
  Branches     1960     1961    +1     
+ Hits         6517     6519    +2     
  Misses         99       99           
  Partials       88       88           
Impacted Files Coverage Δ
src/Chunk.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 f3b1c81...e05babf. Read the comment docs.

@lukastaegert lukastaegert merged commit a14cbb1 into master Feb 23, 2021
9 checks passed
9 checks passed
14 (Windows)
12 (Windows)
10 (Windows)
ci/circleci: analysis Your tests passed on CircleCI!
ci/circleci: node-v10-latest Your tests passed on CircleCI!
ci/circleci: node-v12-latest Your tests passed on CircleCI!
ci/circleci: node-v14-latest Your tests passed on CircleCI!
codecov/patch 100.00% of diff hit (target 97.21%)
codecov/project 97.21% (+0.00%) compared to f3b1c81
@lukastaegert lukastaegert deleted the gh-3969_avoid_builtin_conflicts branch Feb 23, 2021
Copy link

@bva-mike bva-mike commented Mar 2, 2021

Is it possible to add to this list of local variables? As i'm currently getting this issue : zloirock/core-js#587

This was referenced Mar 6, 2021
This was referenced Mar 15, 2021
Copy link
Member Author

@lukastaegert lukastaegert commented Mar 30, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants