Skip to content

Prevent using "arguments" for generated variable names#4613

Merged
lukastaegert merged 1 commit intomasterfrom
gh-4612-no-arguments-as-variable
Aug 19, 2022
Merged

Prevent using "arguments" for generated variable names#4613
lukastaegert merged 1 commit intomasterfrom
gh-4612-no-arguments-as-variable

Conversation

@lukastaegert
Copy link
Copy Markdown
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 #4612

Description

While "arguments" is not a reserved word in JavaScript, it cannot be used for declaring variables in strict mode, so this adds some special logic to prevent this.

@github-actions
Copy link
Copy Markdown

Thank you for your contribution! ❤️

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

npm install rollup/rollup#gh-4612-no-arguments-as-variable

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

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 19, 2022

Codecov Report

Merging #4613 (4f5894a) into master (a8647da) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4613   +/-   ##
=======================================
  Coverage   98.87%   98.87%           
=======================================
  Files         209      209           
  Lines        7366     7368    +2     
  Branches     2102     2103    +1     
=======================================
+ Hits         7283     7285    +2     
  Misses         27       27           
  Partials       56       56           
Impacted Files Coverage Δ
src/utils/identifierHelpers.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lukastaegert lukastaegert merged commit a85327c into master Aug 19, 2022
@lukastaegert lukastaegert deleted the gh-4612-no-arguments-as-variable branch August 19, 2022 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.

Non-strict-mode-compliant codegen for entry with the name arguments containing mixed exports

1 participant