-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 create outside variable when shadowed by catch parameter #4178
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#gh-4176-wrong-catch-scope or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #4178 +/- ##
=======================================
Coverage 98.33% 98.33%
=======================================
Files 202 202
Lines 7220 7221 +1
Branches 2111 2111
=======================================
+ Hits 7100 7101 +1
Misses 58 58
Partials 62 62
Continue to review full report at Codecov.
|
This parse issue may be beyond rollup's control... Given:
Expected output on all NodeJS versions I tried (agrees with Chrome and Firefox):
Actual:
The error comes from acorn:
|
Never mind. Evidently if the file suffix is changed from I take it that Rollup implicitly assumes all input is a module? |
Exactly, there is an option passed to acorn with that assumption |
There is a regression in latest release, in PR rollup/rollup#4178
There is a regression in latest release, which caused a OOM. Issue: rollup/rollup#4181, Probably this PR rollup/rollup#4178 caused a regression.
There is a regression in latest release, which caused a OOM. Issue: rollup/rollup#4181, Probably this PR rollup/rollup#4178 caused a regression.
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #4176
Description
Apparently, a
var
declared in a catch clause will always create a hoisted variable, even if the variable name matches the clause parameter. If that is the case, then the initializer goes to the parameter instead of the variable...This handles this correctly by always creating a hoisted variable while deoptimizing the catch parameter if there is a conflict.