mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement [Inline] interfaces
Inline interfaces just appear as a Rust type and in the TypeId hierarchy. They are completely invisible on the JS side.
This commit is contained in:
parent
b745866a4d
commit
5a42bb58f9
12 changed files with 91 additions and 36 deletions
|
@ -88,6 +88,8 @@ class Configuration:
|
|||
getter = lambda x: x.interface.isJSImplemented()
|
||||
elif key == 'isGlobal':
|
||||
getter = lambda x: x.isGlobal()
|
||||
elif key == 'isInline':
|
||||
getter = lambda x: x.interface.getExtendedAttribute('Inline') is not None
|
||||
elif key == 'isExposedConditionally':
|
||||
getter = lambda x: x.interface.isExposedConditionally()
|
||||
elif key == 'isIteratorInterface':
|
||||
|
@ -234,6 +236,7 @@ class Descriptor(DescriptorProvider):
|
|||
self.concrete = (not self.interface.isCallback() and
|
||||
not self.interface.isNamespace() and
|
||||
not self.interface.getExtendedAttribute("Abstract") and
|
||||
not self.interface.getExtendedAttribute("Inline") and
|
||||
not spiderMonkeyInterface)
|
||||
self.hasUnforgeableMembers = (self.concrete and
|
||||
any(MemberIsUnforgeable(m, self) for m in
|
||||
|
@ -383,8 +386,12 @@ class Descriptor(DescriptorProvider):
|
|||
return attrs
|
||||
|
||||
def getParentName(self):
|
||||
assert self.interface.parent is not None
|
||||
return self.interface.parent.identifier.name
|
||||
parent = self.interface.parent
|
||||
while parent:
|
||||
if not parent.getExtendedAttribute("Inline"):
|
||||
return parent.identifier.name
|
||||
parent = parent.parent
|
||||
return None
|
||||
|
||||
def hasDescendants(self):
|
||||
return (self.interface.getUserData("hasConcreteDescendant", False) or
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue