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
Test that WindowProxy's [[Set]] fails early for OOB indices #29377
base: master
Are you sure you want to change the base?
Test that WindowProxy's [[Set]] fails early for OOB indices #29377
Conversation
window[2] = 2; | ||
assert_false(window.hasOwnProperty(2)); | ||
Object.defineProperty(EventTarget.prototype, 42, { set: t.unreached_func("EventTarget.prototype[42] setter should be unreachable!") }); | ||
assert_false(Reflect.set(window, 42, "foo")); |
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.
Is there a particular reason to use Reflect.set
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.
In sloppy mode, there is no way to test return value of [[Set]]
being false
except using Reflect.set
.
Chrome returns true
instead of false
.
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.
Can you use a normal set here, and put the Reflect
check in a separate test()
below?
Hmm maybe I shouldn't have merged the spec PR so quickly. You claim that all browsers have the behavior, but https://wpt.fyi/results/html/browsers/the-window-object/window-indexed-properties.html?diff&filter=ADC&run_id=5103827915112448&run_id=5652311210721280 shows that Chrome does not? |
@domenic Chrome fails newly added test for the same reason it fails the existing |
I mean, if Reflect.set doesn't return false, then how do you know it failed to set? |
Since |
Ref. whatwg/html#6767.