@@ -2641,7 +2641,7 @@ def CreateBindingJSObject(descriptor):
26412641rooted!(in(*cx) let private = PrivateValue(raw as *const libc::c_void));
26422642let obj = NewProxyObject(*cx, handler,
26432643 Handle::from_raw(UndefinedHandleValue),
2644- proto.get());
2644+ proto.get(), ptr::null(), false );
26452645assert!(!obj.is_null());
26462646SetProxyReservedSlot(obj, 0, &private.get());
26472647rooted!(in(*cx) let obj = obj);\
@@ -3007,6 +3007,14 @@ def definition_body(self):
30073007%s;
30083008assert!(!prototype_proto.is_null());""" % getPrototypeProto )]
30093009
3010+ if self .descriptor .hasNamedPropertiesObject ():
3011+ assert self .descriptor .isGlobal ()
3012+ assert not self .haveUnscopables
3013+ code .append (CGGeneric ("""\
3014+ rooted!(in(*cx) let mut prototype_proto_proto = prototype_proto.get());
3015+ dom::types::%s::create_named_properties_object(cx, prototype_proto_proto.handle(), prototype_proto.handle_mut());
3016+ assert!(!prototype_proto.is_null());""" % name ))
3017+
30103018 properties = {
30113019 "id" : name ,
30123020 "unscopables" : "unscopable_names" if self .haveUnscopables else "&[]" ,
@@ -3033,6 +3041,9 @@ def definition_body(self):
30333041
30343042 code .append (CGGeneric ("""
30353043rooted!(in(*cx) let mut prototype = ptr::null_mut::<JSObject>());
3044+ """ ))
3045+
3046+ code .append (CGGeneric ("""
30363047create_interface_prototype_object(cx,
30373048 global.into(),
30383049 prototype_proto.handle().into(),
@@ -3042,6 +3053,9 @@ def definition_body(self):
30423053 %(consts)s,
30433054 %(unscopables)s,
30443055 prototype.handle_mut().into());
3056+ """ % proto_properties ))
3057+
3058+ code .append (CGGeneric ("""
30453059assert!(!prototype.is_null());
30463060assert!((*cache)[PrototypeList::ID::%(id)s as usize].is_null());
30473061(*cache)[PrototypeList::ID::%(id)s as usize] = prototype.get();
@@ -5147,8 +5161,8 @@ def getBody(self):
51475161 attrs = "JSPROP_ENUMERATE"
51485162 if self .descriptor .operations ['IndexedSetter' ] is None :
51495163 attrs += " | JSPROP_READONLY"
5150- fillDescriptor = ("desc.value = result_root.get(); \n "
5151- "fill_property_descriptor(MutableHandle::from_raw(desc ), proxy .get(), (%s) as u32);\n "
5164+ fillDescriptor = ("fill_property_descriptor(MutableHandle::from_raw(desc), "
5165+ "proxy.get( ), result_root .get(), (%s) as u32);\n "
51525166 "return true;" % attrs )
51535167 templateValues = {
51545168 'jsvalRef' : 'result_root.handle_mut()' ,
@@ -5161,8 +5175,7 @@ def getBody(self):
51615175 CGIndenter (CGProxyIndexedGetter (self .descriptor , templateValues )).define () + "\n " +
51625176 "}\n " )
51635177
5164- namedGetter = self .descriptor .operations ['NamedGetter' ]
5165- if namedGetter :
5178+ if self .descriptor .operations ['NamedGetter' ]:
51665179 attrs = []
51675180 if not self .descriptor .interface .getExtendedAttribute ("LegacyUnenumerableNamedProperties" ):
51685181 attrs .append ("JSPROP_ENUMERATE" )
@@ -5172,8 +5185,8 @@ def getBody(self):
51725185 attrs = " | " .join (attrs )
51735186 else :
51745187 attrs = "0"
5175- fillDescriptor = ("desc.value = result_root.get(); \n "
5176- "fill_property_descriptor(MutableHandle::from_raw(desc ), proxy .get(), (%s) as u32);\n "
5188+ fillDescriptor = ("fill_property_descriptor(MutableHandle::from_raw(desc), "
5189+ "proxy.get( ), result_root .get(), (%s) as u32);\n "
51775190 "return true;" % attrs )
51785191 templateValues = {
51795192 'jsvalRef' : 'result_root.handle_mut()' ,
@@ -5419,11 +5432,10 @@ def getBody(self):
54195432 " return true;\n " +
54205433 "}\n \n " )
54215434
5422- namedGetter = self .descriptor .operations ['NamedGetter' ]
54235435 condition = "RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id)"
54245436 if indexedGetter :
54255437 condition = "index.is_none() && (%s)" % condition
5426- if namedGetter :
5438+ if self . descriptor . operations [ 'NamedGetter' ] :
54275439 named = """\
54285440 if %s {
54295441 let mut has_on_proto = false;
@@ -5506,8 +5518,7 @@ def getBody(self):
55065518 else :
55075519 getIndexedOrExpando = getFromExpando + "\n "
55085520
5509- namedGetter = self .descriptor .operations ['NamedGetter' ]
5510- if namedGetter :
5521+ if self .descriptor .operations ['NamedGetter' ]:
55115522 condition = "RUST_JSID_IS_STRING(id) || RUST_JSID_IS_INT(id)"
55125523 # From step 1:
55135524 # If O supports indexed properties and P is an array index, then:
@@ -5859,6 +5870,7 @@ def contains_unsafe_arg(arguments):
58595870 return functools .reduce ((lambda x , y : x or y [1 ] == '*mut JSContext' ), arguments , False )
58605871
58615872 methods = []
5873+
58625874 for name , arguments , rettype in members ():
58635875 arguments = list (arguments )
58645876 methods .append (CGGeneric ("%sfn %s(&self%s) -> %s;\n " % (
@@ -6179,6 +6191,7 @@ def reexportedName(name):
61796191
61806192 defaultToJSONMethod = None
61816193 unscopableNames = []
6194+
61826195 for m in descriptor .interface .members :
61836196 if (m .isMethod () and
61846197 (not m .isIdentifierLess () or m == descriptor .operations ["Stringifier" ])):
@@ -6214,7 +6227,7 @@ def reexportedName(name):
62146227 elif m .getExtendedAttribute ("Replaceable" ):
62156228 cgThings .append (CGSpecializedReplaceableSetter (descriptor , m ))
62166229
6217- if ( not m .isStatic () and not descriptor .interface .isCallback () ):
6230+ if not m .isStatic () and not descriptor .interface .isCallback ():
62186231 cgThings .append (CGMemberJITInfo (descriptor , m ))
62196232
62206233 if defaultToJSONMethod :
0 commit comments