From b783d967496bac42fe6c30817ebdc8b2e739a416 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 25 Dec 2015 04:54:33 +0100 Subject: Make fill_property_descriptor take a flags argument --- components/script/dom/bindings/codegen/CodegenRust.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'components/script/dom/bindings/codegen/CodegenRust.py') 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, -- cgit v1.2.3