mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Introduce Descriptor.prototypeDepth
This commit is contained in:
parent
7693aecf15
commit
d52948dfd5
2 changed files with 3 additions and 2 deletions
|
@ -2283,8 +2283,8 @@ class CGIDLInterface(CGThing):
|
||||||
name = self.descriptor.name
|
name = self.descriptor.name
|
||||||
if (interface.getUserData("hasConcreteDescendant", False) or
|
if (interface.getUserData("hasConcreteDescendant", False) or
|
||||||
interface.getUserData("hasProxyDescendant", False)):
|
interface.getUserData("hasProxyDescendant", False)):
|
||||||
depth = len(self.descriptor.prototypeChain)
|
depth = self.descriptor.prototypeDepth
|
||||||
check = "class.interface_chain[%s] == PrototypeList::ID::%s" % (depth - 1, name)
|
check = "class.interface_chain[%s] == PrototypeList::ID::%s" % (depth, name)
|
||||||
elif self.descriptor.proxy:
|
elif self.descriptor.proxy:
|
||||||
check = "class as *const _ == &Class as *const _"
|
check = "class as *const _ == &Class as *const _"
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -296,6 +296,7 @@ class Descriptor(DescriptorProvider):
|
||||||
while parent:
|
while parent:
|
||||||
self.prototypeChain.insert(0, parent.identifier.name)
|
self.prototypeChain.insert(0, parent.identifier.name)
|
||||||
parent = parent.parent
|
parent = parent.parent
|
||||||
|
self.prototypeDepth = len(self.prototypeChain) - 1
|
||||||
config.maxProtoChainLength = max(config.maxProtoChainLength,
|
config.maxProtoChainLength = max(config.maxProtoChainLength,
|
||||||
len(self.prototypeChain))
|
len(self.prototypeChain))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue