Use the custom defineProperty trap when it exists.

This commit is contained in:
Bruno de Oliveira Abinader 2014-12-23 13:39:42 +01:00 committed by Ms2ger
parent c82eb3b1a4
commit ade0b7be8e
3 changed files with 5 additions and 19 deletions

View file

@ -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)

View file

@ -1,5 +0,0 @@
[storage_session_length_js.html]
type: testharness
[Web Storage]
expected: FAIL

View file

@ -1,11 +1,5 @@
[storage_session_setitem_js.html]
type: testharness
[Web Storage 2]
expected: FAIL
[Web Storage 3]
expected: FAIL
[Web Storage 4]
expected: FAIL
@ -24,9 +18,3 @@
[Web Storage 10]
expected: FAIL
[Web Storage 12]
expected: FAIL
[Web Storage 14]
expected: FAIL