mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 785472 - The Web IDL parser should not allow inheriting from an interface that is only forward declared; r=khuey
This commit is contained in:
parent
b1634fb871
commit
0ab97da3c8
@ -422,6 +422,12 @@ class IDLInterface(IDLObjectWithScope):
|
||||
|
||||
assert not self.parent or isinstance(self.parent, IDLIdentifierPlaceholder)
|
||||
parent = self.parent.finish(scope) if self.parent else None
|
||||
if parent and isinstance(parent, IDLExternalInterface):
|
||||
raise WebIDLError("%s inherits from %s which does not have "
|
||||
"a definition" %
|
||||
(self.identifier.name,
|
||||
self.parent.identifier.name),
|
||||
[self.location])
|
||||
assert not parent or isinstance(parent, IDLInterface)
|
||||
|
||||
self.parent = parent
|
||||
|
@ -173,3 +173,16 @@ def WebIDLTest(parser, harness):
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should not allow indirectly inheriting from an interface that indirectly implements us")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse("""
|
||||
interface A;
|
||||
interface B : A {};
|
||||
""")
|
||||
results = parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should not allow inheriting from an interface that is only forward declared")
|
||||
|
Loading…
Reference in New Issue
Block a user