mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Use the custom defineProperty trap when it exists.
This commit is contained in:
parent
c82eb3b1a4
commit
ade0b7be8e
3 changed files with 5 additions and 19 deletions
|
@ -2086,11 +2086,14 @@ class CGDefineProxyHandler(CGAbstractMethod):
|
|||
return CGAbstractMethod.define(self)
|
||||
|
||||
def definition_body(self):
|
||||
customDefineProperty = 'defineProperty_'
|
||||
if self.descriptor.operations['IndexedSetter'] or self.descriptor.operations['NamedSetter']:
|
||||
customDefineProperty = 'defineProperty'
|
||||
body = """\
|
||||
let traps = ProxyTraps {
|
||||
getPropertyDescriptor: Some(getPropertyDescriptor),
|
||||
getOwnPropertyDescriptor: Some(getOwnPropertyDescriptor),
|
||||
defineProperty: Some(defineProperty_),
|
||||
defineProperty: Some(%s),
|
||||
getOwnPropertyNames: ptr::null(),
|
||||
delete_: Some(delete_),
|
||||
enumerate: ptr::null(),
|
||||
|
@ -2120,7 +2123,7 @@ let traps = ProxyTraps {
|
|||
};
|
||||
|
||||
CreateProxyHandler(&traps, &Class as *const _ as *const _)
|
||||
""" % (FINALIZE_HOOK_NAME,
|
||||
""" % (customDefineProperty, FINALIZE_HOOK_NAME,
|
||||
TRACE_HOOK_NAME)
|
||||
return CGGeneric(body)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue