-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add Symbol.unscopables lexical scope test of compiled event handlers #26091
Add Symbol.unscopables lexical scope test of compiled event handlers #26091
Conversation
All browsers fail this test, so it should probably be flipped, and the spec changed accordingly. |
9e56514
to
0964780
Compare
@ExE-Boss if there's a difference between setting withEnvironment on the innermost and most scopes it'd be good to have test coverage for that as well. |
4b2a5d2
to
95c8f9d
Compare
@annevk I’ve now also added test cases for the |
95c8f9d
to
3a529ac
Compare
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.
This looks great. Just some minor tidying nits.
And I guess I should file a bug on Safari for not having the same unscopables. I wonder if there's a test for that somewhere... (Turns out this is tested by IDL harness tests and Safari has some failures for Fullscreen.)
html/webappapis/scripting/events/compile-event-handler-symbol-unscopables.html
Outdated
Show resolved
Hide resolved
html/webappapis/scripting/events/compile-event-handler-symbol-unscopables.html
Outdated
Show resolved
Hide resolved
html/webappapis/scripting/events/compile-event-handler-symbol-unscopables.html
Outdated
Show resolved
Hide resolved
(I decided to land this as everyone agrees this is the behavior these should have and we have a specification change pending that can land as soon as ECMAScript has had a slight refactoring.) |
Step 9 of get the current value of the event handler initialises the
ObjectEnvironment
records without setting thewithEnvironment
flag totrue
, which is required to make theObjectEnvironment
respectSymbol.unscopables
.As such, inline event handlers are required to include unscopable properties.
See also:
ObjectEnvironment.HasBinding(n)
WithStatement
Evaluation