-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
[Merged by Bors] - Fix var collisions in strict eval calls #2382
Conversation
Test262 conformance changes
Fixed tests (3):
|
Codecov Report
@@ Coverage Diff @@
## main #2382 +/- ##
==========================================
+ Coverage 39.93% 40.02% +0.09%
==========================================
Files 304 304
Lines 23308 23306 -2
==========================================
+ Hits 9307 9328 +21
+ Misses 14001 13978 -23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
2d1b2a6
to
ac4e5dc
Compare
bors r+ |
This Pull Request allows collisions of var declarations with already existing lexical bindings if the `eval` call is strict or occurs within strict code. In short, it allows: ```Javascript { let x; { eval('"use strict"; var x;'); } } ``` and ```Javascript "use strict"; { let x; { eval('var x;'); } } ``` This is valid since in strict code all `eval` calls get their own function environment, making it impossible to declare a new var in the outer function environment. This change also skips poisoning environments on strict code, because `eval` cannot add new declarations for the current environment in that situation.
Pull request successfully merged into main. Build succeeded: |
This Pull Request allows collisions of var declarations with already existing lexical bindings if the
eval
call is strict or occurs within strict code. In short, it allows:and
This is valid since in strict code all
eval
calls get their own function environment, making it impossible to declare a new var in the outer function environment. This change also skips poisoning environments on strict code, becauseeval
cannot add new declarations for the current environment in that situation.