4 def WebIDLTest(parser
, harness
):
10 legacycaller Promise<any> foo();
16 except WebIDL
.WebIDLError
:
18 harness
.ok(threw
, "Should not allow Promise return values for legacycaller.")
20 parser
= parser
.reset()
32 except WebIDL
.WebIDLError
:
36 "Should not allow overloads which have both Promise and "
37 "non-Promise return types.",
40 parser
= parser
.reset()
52 except WebIDL
.WebIDLError
:
56 "Should not allow overloads which have both Promise and "
57 "non-Promise return types.",
60 parser
= parser
.reset()
71 except WebIDL
.WebIDLError
:
73 harness
.ok(threw
, "Should not allow nullable Promise return values.")
75 parser
= parser
.reset()
81 undefined foo(Promise<any>? arg);
86 except WebIDL
.WebIDLError
:
88 harness
.ok(threw
, "Should not allow nullable Promise arguments.")
90 parser
= parser
.reset()
95 Promise<any> foo(long arg);
102 True, "Should allow overloads which only have Promise and return " "types."
105 parser
= parser
.reset()
111 attribute Promise<any> attr;
116 except WebIDL
.WebIDLError
:
118 harness
.ok(threw
, "Should not allow writable Promise-typed attributes.")
120 parser
= parser
.reset()
126 [LegacyLenientSetter] readonly attribute Promise<any> attr;
131 except WebIDL
.WebIDLError
:
134 threw
, "Should not allow [LegacyLenientSetter] Promise-typed attributes."
137 parser
= parser
.reset()
143 [PutForwards=bar] readonly attribute Promise<any> attr;
148 except WebIDL
.WebIDLError
:
150 harness
.ok(threw
, "Should not allow [PutForwards] Promise-typed attributes.")
152 parser
= parser
.reset()
158 [Replaceable] readonly attribute Promise<any> attr;
163 except WebIDL
.WebIDLError
:
165 harness
.ok(threw
, "Should not allow [Replaceable] Promise-typed attributes.")
167 parser
= parser
.reset()
173 [SameObject] readonly attribute Promise<any> attr;
178 except WebIDL
.WebIDLError
:
180 harness
.ok(threw
, "Should not allow [SameObject] Promise-typed attributes.")