Loading dom/bindings/parser/WebIDL.py +3 −1 Original line number Diff line number Diff line Loading @@ -2789,9 +2789,11 @@ class IDLTypedefType(IDLType): class IDLTypedef(IDLObjectWithIdentifier): def __init__(self, location, parentScope, innerType, name): # Set self.innerType first, because IDLObjectWithIdentifier.__init__ # will call our __str__, which wants to use it. self.innerType = innerType identifier = IDLUnresolvedIdentifier(location, name) IDLObjectWithIdentifier.__init__(self, location, parentScope, identifier) self.innerType = innerType def __str__(self): return "Typedef %s %s" % (self.identifier.name, self.innerType) Loading dom/bindings/parser/tests/test_typedef_identifier_conflict.py 0 → 100644 +16 −0 Original line number Diff line number Diff line def WebIDLTest(parser, harness): exception = None try: parser.parse( """ typedef long foo; typedef long foo; """) results = parser.finish() except Exception as e: exception = e harness.ok(exception, "Should have thrown.") harness.ok("Multiple unresolvable definitions of identifier 'foo'" in str(exception), "Should have a sane exception message") Loading
dom/bindings/parser/WebIDL.py +3 −1 Original line number Diff line number Diff line Loading @@ -2789,9 +2789,11 @@ class IDLTypedefType(IDLType): class IDLTypedef(IDLObjectWithIdentifier): def __init__(self, location, parentScope, innerType, name): # Set self.innerType first, because IDLObjectWithIdentifier.__init__ # will call our __str__, which wants to use it. self.innerType = innerType identifier = IDLUnresolvedIdentifier(location, name) IDLObjectWithIdentifier.__init__(self, location, parentScope, identifier) self.innerType = innerType def __str__(self): return "Typedef %s %s" % (self.identifier.name, self.innerType) Loading
dom/bindings/parser/tests/test_typedef_identifier_conflict.py 0 → 100644 +16 −0 Original line number Diff line number Diff line def WebIDLTest(parser, harness): exception = None try: parser.parse( """ typedef long foo; typedef long foo; """) results = parser.finish() except Exception as e: exception = e harness.ok(exception, "Should have thrown.") harness.ok("Multiple unresolvable definitions of identifier 'foo'" in str(exception), "Should have a sane exception message")