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

Prevent using "arguments" for generated variable names #4613

Merged
merged 1 commit into from Aug 19, 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 #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

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

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