Summary: | Object.setPrototypeOf() should throw when used on a cross-origin Window / Location object | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bzbarsky, cdumez, commit-queue, darin, ggaren, keith_miller, mark.lam, msaboff, rniwa, saam, sam | ||||||
Priority: | P2 | Keywords: | WebExposed | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=161393 https://bugs.webkit.org/show_bug.cgi?id=161455 |
||||||||
Attachments: |
|
Description
Chris Dumez
2016-08-30 12:44:22 PDT
Created attachment 287421 [details]
Patch
Created attachment 287423 [details]
Patch
Object.setPrototypeOf should throw on a same-origin Window too (but not on same-origin Location). (In reply to comment #3) > Object.setPrototypeOf should throw on a same-origin Window too (but not on > same-origin Location). As mentioned in the ChangeLog, I intentionally did not change the same-origin case in this patch. I'll consider making this change in a follow-up. Also, could you clarify why it would throw for same-origin Location? The specification for Location and Window seems identical: - https://html.spec.whatwg.org/#windowproxy-setprototypeof - https://html.spec.whatwg.org/#location-setprototypeof > I'll consider making this change in a follow-up. Ah, ok. > Also, could you clarify why it would throw for same-origin Location? I assume that's missing a negative somewhere... I was wrong. It looks like the spec says to throw for Object.setPrototypeOf on a same-origin location (and at least Gecko does in fact do that). Comment on attachment 287423 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=287423&action=review > Source/JavaScriptCore/runtime/ObjectConstructor.cpp:233 > + throwTypeError(exec, ASCIILiteral("permission denied")); Capitalize p? Committed r205205: <http://trac.webkit.org/changeset/205205> |