mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Generate GetConstructorObject for all interfaces
This commit is contained in:
parent
147dfcc99b
commit
0713257add
2 changed files with 6 additions and 2 deletions
|
@ -2863,7 +2863,7 @@ create_noncallback_interface_object(cx,
|
||||||
%(length)s,
|
%(length)s,
|
||||||
interface.handle_mut());
|
interface.handle_mut());
|
||||||
assert!(!interface.is_null());""" % properties))
|
assert!(!interface.is_null());""" % properties))
|
||||||
if self.descriptor.hasDescendants():
|
if self.descriptor.shouldCacheConstructor():
|
||||||
code.append(CGGeneric("""\
|
code.append(CGGeneric("""\
|
||||||
assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null());
|
assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null());
|
||||||
(*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.get();
|
(*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.get();
|
||||||
|
|
|
@ -398,7 +398,11 @@ class Descriptor(DescriptorProvider):
|
||||||
assert self.interface.hasInterfaceObject()
|
assert self.interface.hasInterfaceObject()
|
||||||
if self.interface.getExtendedAttribute("Inline"):
|
if self.interface.getExtendedAttribute("Inline"):
|
||||||
return False
|
return False
|
||||||
return self.interface.isCallback() or self.interface.isNamespace() or self.hasDescendants()
|
return (self.interface.isCallback() or self.interface.isNamespace() or
|
||||||
|
self.hasDescendants() or self.interface.getExtendedAttribute("HTMLConstructor"))
|
||||||
|
|
||||||
|
def shouldCacheConstructor(self):
|
||||||
|
return self.hasDescendants() or self.interface.getExtendedAttribute("HTMLConstructor")
|
||||||
|
|
||||||
def isExposedConditionally(self):
|
def isExposedConditionally(self):
|
||||||
return self.interface.isExposedConditionally()
|
return self.interface.isExposedConditionally()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue