Update WebIDL

This commit is contained in:
sagudev
2023-02-19 13:36:13 +01:00
parent 6f563830d1
commit 4d393612b4
77 changed files with 9035 additions and 4668 deletions

View File

@@ -1,11 +1,13 @@
def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions(DOMString a)] undefined foo(boolean arg2);
};
""")
"""
)
results = parser.finish()
except:
@@ -16,11 +18,13 @@ def WebIDLTest(parser, harness):
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions(DOMString b)] readonly attribute boolean bar;
};
""")
"""
)
results = parser.finish()
except:
@@ -31,54 +35,72 @@ def WebIDLTest(parser, harness):
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions] attribute boolean bar;
};
""")
"""
)
results = parser.finish()
except Exception as e:
harness.ok(False, "Shouldn't have thrown for [CEReactions] used on writable attribute. %s" % e)
harness.ok(
False,
"Shouldn't have thrown for [CEReactions] used on writable attribute. %s"
% e,
)
threw = True
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions] undefined foo(boolean arg2);
};
""")
"""
)
results = parser.finish()
except Exception as e:
harness.ok(False, "Shouldn't have thrown for [CEReactions] used on regular operations. %s" % e)
harness.ok(
False,
"Shouldn't have thrown for [CEReactions] used on regular operations. %s"
% e,
)
threw = True
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions] readonly attribute boolean A;
};
""")
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown for [CEReactions] used on a readonly attribute")
harness.ok(
threw, "Should have thrown for [CEReactions] used on a readonly attribute"
)
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
[CEReactions]
interface Foo {
}
""")
"""
)
results = parser.finish()
except:
@@ -89,45 +111,47 @@ def WebIDLTest(parser, harness):
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions] getter any(DOMString name);
};
""")
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Should have thrown for [CEReactions] used on a named getter")
harness.ok(threw, "Should have thrown for [CEReactions] used on a named getter")
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions] legacycaller double compute(double x);
};
""")
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Should have thrown for [CEReactions] used on a legacycaller")
harness.ok(threw, "Should have thrown for [CEReactions] used on a legacycaller")
parser = parser.reset()
threw = False
try:
parser.parse("""
parser.parse(
"""
interface Foo {
[CEReactions] stringifier DOMString ();
};
""")
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Should have thrown for [CEReactions] used on a stringifier")
harness.ok(threw, "Should have thrown for [CEReactions] used on a stringifier")