michael@0: def WebIDLTest(parser, harness): michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface VariadicConstraints1 { michael@0: void foo(byte... arg1, byte arg2); michael@0: }; michael@0: """) michael@0: results = parser.finish() michael@0: michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, michael@0: "Should have thrown on variadic argument followed by required " michael@0: "argument.") michael@0: michael@0: parser = parser.reset() michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface VariadicConstraints2 { michael@0: void foo(byte... arg1, optional byte arg2); michael@0: }; michael@0: """) michael@0: results = parser.finish(); michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, michael@0: "Should have thrown on variadic argument followed by optional " michael@0: "argument.") michael@0: michael@0: parser = parser.reset() michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface VariadicConstraints3 { michael@0: void foo(optional byte... arg1); michael@0: }; michael@0: """) michael@0: results = parser.finish() michael@0: michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, michael@0: "Should have thrown on variadic argument explicitly flagged as " michael@0: "optional.") michael@0: michael@0: parser = parser.reset() michael@0: threw = False michael@0: try: michael@0: parser.parse(""" michael@0: interface VariadicConstraints4 { michael@0: void foo(byte... arg1 = 0); michael@0: }; michael@0: """) michael@0: results = parser.finish() michael@0: except: michael@0: threw = True michael@0: michael@0: harness.ok(threw, "Should have thrown on variadic argument with default value.")