|
1 def WebIDLTest(parser, harness): |
|
2 threw = False |
|
3 try: |
|
4 parser.parse(""" |
|
5 interface OneNullableInUnion { |
|
6 void foo((object? or DOMString?) arg); |
|
7 }; |
|
8 """) |
|
9 |
|
10 results = parser.finish() |
|
11 except: |
|
12 threw = True |
|
13 |
|
14 harness.ok(threw, |
|
15 "Two nullable member types of a union should have thrown.") |
|
16 |
|
17 parser.reset() |
|
18 threw = False |
|
19 |
|
20 try: |
|
21 parser.parse(""" |
|
22 interface NullableInNullableUnion { |
|
23 void foo((object? or DOMString)? arg); |
|
24 }; |
|
25 """) |
|
26 |
|
27 results = parser.finish() |
|
28 except: |
|
29 threw = True |
|
30 |
|
31 harness.ok(threw, |
|
32 "A nullable union type with a nullable member type should have " |
|
33 "thrown.") |
|
34 |
|
35 parser.reset() |
|
36 threw = False |
|
37 |
|
38 try: |
|
39 parser.parse(""" |
|
40 interface NullableInUnionNullableUnionHelper { |
|
41 }; |
|
42 interface NullableInUnionNullableUnion { |
|
43 void foo(((object? or DOMString) or NullableInUnionNullableUnionHelper)? arg); |
|
44 }; |
|
45 """) |
|
46 |
|
47 results = parser.finish() |
|
48 except: |
|
49 threw = True |
|
50 |
|
51 harness.ok(threw, |
|
52 "A nullable union type with a nullable member type should have " |
|
53 "thrown.") |