mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
feat(script): implement getOwnEnumerablePropertyKeys
for Location
Fixes the following assertion from `tests/wpt/web-platform-tests/html/ browsers/origin/cross-origin-objects/cross-origin-objects.html`: assert_equals(Object.keys(win.location).length, 0, "Object.keys() gives the right answer for cross-origin Location");
This commit is contained in:
parent
75242d6c4c
commit
a6b2f75656
1 changed files with 6 additions and 3 deletions
|
@ -3559,7 +3559,8 @@ class CGDefineProxyHandler(CGAbstractMethod):
|
|||
customSet = 'Some(set)'
|
||||
|
||||
getOwnEnumerablePropertyKeys = "own_property_keys"
|
||||
if self.descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties"):
|
||||
if self.descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties") or \
|
||||
self.descriptor.isMaybeCrossOriginObject():
|
||||
getOwnEnumerablePropertyKeys = "getOwnEnumerablePropertyKeys"
|
||||
|
||||
args = {
|
||||
|
@ -5726,7 +5727,8 @@ class CGDOMJSProxyHandler_ownPropertyKeys(CGAbstractExternMethod):
|
|||
class CGDOMJSProxyHandler_getOwnEnumerablePropertyKeys(CGAbstractExternMethod):
|
||||
def __init__(self, descriptor):
|
||||
assert (descriptor.operations["IndexedGetter"]
|
||||
and descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties"))
|
||||
and descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties")
|
||||
or descriptor.isMaybeCrossOriginObject())
|
||||
args = [Argument('*mut JSContext', 'cx'),
|
||||
Argument('RawHandleObject', 'proxy'),
|
||||
Argument('RawMutableHandleIdVector', 'props')]
|
||||
|
@ -6671,7 +6673,8 @@ class CGDescriptor(CGThing):
|
|||
cgThings.append(CGProxyUnwrap(descriptor))
|
||||
cgThings.append(CGDOMJSProxyHandlerDOMClass(descriptor))
|
||||
cgThings.append(CGDOMJSProxyHandler_ownPropertyKeys(descriptor))
|
||||
if descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties"):
|
||||
if descriptor.interface.getExtendedAttribute("LegacyUnenumerableNamedProperties") or \
|
||||
descriptor.isMaybeCrossOriginObject():
|
||||
cgThings.append(CGDOMJSProxyHandler_getOwnEnumerablePropertyKeys(descriptor))
|
||||
cgThings.append(CGDOMJSProxyHandler_getOwnPropertyDescriptor(descriptor))
|
||||
cgThings.append(CGDOMJSProxyHandler_className(descriptor))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue