aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--components/script/dom/bindings/codegen/CodegenRust.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index ec1a0a7ec15..e6a4c5c1365 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -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,