michael@0: import WebIDL michael@0: michael@0: def WebIDLTest(parser, harness): michael@0: parser.parse(""" michael@0: interface TestStringifier { michael@0: stringifier; michael@0: }; michael@0: """) michael@0: michael@0: results = parser.finish() michael@0: michael@0: harness.ok(isinstance(results[0].members[0], WebIDL.IDLMethod), michael@0: "Stringifer should be method") michael@0: michael@0: parser = parser.reset() michael@0: michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface TestStringifier { michael@0: stringifier; michael@0: stringifier; michael@0: }; michael@0: """) michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should not allow two 'stringifier;'") michael@0: michael@0: parser = parser.reset() michael@0: michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface TestStringifier { michael@0: stringifier; michael@0: stringifier DOMString foo(); michael@0: }; michael@0: """) michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should not allow a 'stringifier;' and a 'stringifier()'") michael@0: