1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 def should_throw(parser
, harness
, message
, code
):
9 parser
= parser
.reset()
14 except WebIDL
.WebIDLError
:
17 harness
.ok(threw
, "Should have thrown: %s" % message
)
20 def WebIDLTest(parser
, harness
):
21 # The [Replaceable] extended attribute MUST take no arguments.
28 [Replaceable=X] readonly attribute long A;
33 # An attribute with the [Replaceable] extended attribute MUST NOT also be
34 # declared with the [PutForwards] extended attribute.
41 [PutForwards=B, Replaceable] readonly attribute J A;
49 # The [Replaceable] extended attribute MUST NOT be used on an attribute
50 # that is not read only.
57 [Replaceable] attribute long A;
62 # The [Replaceable] extended attribute MUST NOT be used on a static
70 [Replaceable] static readonly attribute long A;
75 # The [Replaceable] extended attribute MUST NOT be used on an attribute
76 # declared on a callback interface.
82 callback interface I {
83 [Replaceable] readonly attribute long A;