mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Make fill_property_descriptor take a flags argument
This commit is contained in:
parent
c95855c7ea
commit
b783d96749
3 changed files with 16 additions and 12 deletions
|
@ -4321,10 +4321,12 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
|||
get = "let index = get_array_index_from_id(cx, id);\n"
|
||||
|
||||
if indexedGetter:
|
||||
readonly = toStringBool(self.descriptor.operations['IndexedSetter'] is None)
|
||||
attrs = "JSPROP_ENUMERATE"
|
||||
if self.descriptor.operations['IndexedSetter'] is None:
|
||||
attrs += " | JSPROP_READONLY"
|
||||
fillDescriptor = ("desc.get().value = result_root.ptr;\n"
|
||||
"fill_property_descriptor(&mut *desc.ptr, *proxy.ptr, %s);\n"
|
||||
"return true;" % readonly)
|
||||
"return true;" % attrs)
|
||||
templateValues = {
|
||||
'jsvalRef': 'result_root.handle_mut()',
|
||||
'successCode': fillDescriptor,
|
||||
|
@ -4338,10 +4340,12 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
|||
|
||||
namedGetter = self.descriptor.operations['NamedGetter']
|
||||
if namedGetter:
|
||||
readonly = toStringBool(self.descriptor.operations['NamedSetter'] is None)
|
||||
attrs = "JSPROP_ENUMERATE"
|
||||
if self.descriptor.operations['IndexedSetter'] is None:
|
||||
attrs += " | JSPROP_READONLY"
|
||||
fillDescriptor = ("desc.get().value = result_root.ptr;\n"
|
||||
"fill_property_descriptor(&mut *desc.ptr, *proxy.ptr, %s);\n"
|
||||
"return true;" % readonly)
|
||||
"return true;" % attrs)
|
||||
templateValues = {
|
||||
'jsvalRef': 'result_root.handle_mut()',
|
||||
'successCode': fillDescriptor,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue