Skip to content

Commit

Permalink
Generate GetConstructorObject for all interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrewster committed Jun 13, 2017
1 parent 147dfcc commit 0713257
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -2863,7 +2863,7 @@ def definition_body(self):
%(length)s,
interface.handle_mut());
assert!(!interface.is_null());""" % properties))
if self.descriptor.hasDescendants():
if self.descriptor.shouldCacheConstructor():
code.append(CGGeneric("""\
assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null());
(*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.get();
Expand Down
6 changes: 5 additions & 1 deletion components/script/dom/bindings/codegen/Configuration.py
Expand Up @@ -398,7 +398,11 @@ def shouldHaveGetConstructorObjectMethod(self):
assert self.interface.hasInterfaceObject()
if self.interface.getExtendedAttribute("Inline"):
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):
return self.interface.isExposedConditionally()
Expand Down

0 comments on commit 0713257

Please sign in to comment.