Update WebIDL.py (#32495)

* Update WebIDL.py

* Update WebIDL.py

* Add builtin-array.patch

* Fix CodegenRust.py and Configuration.py

* Fix missing downcasts

* mach fmt

* Update check and comment to explain why we need this check

* Update Global of DissimilarOriginWindow.webidl
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2024-06-15 13:22:42 +09:00 committed by GitHub
parent 19067366df
commit 8eed3b442b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 1658 additions and 793 deletions

View file

@ -1,7 +1,10 @@
import WebIDL
def WebIDLTest(parser, harness):
parser.parse(
"""
[Global, Exposed=Foo]
[Global=Foo, Exposed=Foo]
interface Foo : Bar {
getter any(DOMString name);
};
@ -26,15 +29,15 @@ def WebIDLTest(parser, harness):
try:
parser.parse(
"""
[Global, Exposed=Foo]
[Global=Foo, Exposed=Foo]
interface Foo {
getter any(DOMString name);
setter undefined(DOMString name, any arg);
};
"""
)
results = parser.finish()
except:
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(
@ -47,15 +50,15 @@ def WebIDLTest(parser, harness):
try:
parser.parse(
"""
[Global, Exposed=Foo]
[Global=Foo, Exposed=Foo]
interface Foo {
getter any(DOMString name);
deleter undefined(DOMString name);
};
"""
)
results = parser.finish()
except:
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(
@ -68,13 +71,13 @@ def WebIDLTest(parser, harness):
try:
parser.parse(
"""
[Global, LegacyOverrideBuiltIns, Exposed=Foo]
[Global=Foo, LegacyOverrideBuiltIns, Exposed=Foo]
interface Foo {
};
"""
)
results = parser.finish()
except:
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(
@ -88,7 +91,7 @@ def WebIDLTest(parser, harness):
try:
parser.parse(
"""
[Global, Exposed=Foo]
[Global=Foo, Exposed=Foo]
interface Foo : Bar {
};
[LegacyOverrideBuiltIns, Exposed=Foo]
@ -96,8 +99,8 @@ def WebIDLTest(parser, harness):
};
"""
)
results = parser.finish()
except:
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(
@ -111,7 +114,7 @@ def WebIDLTest(parser, harness):
try:
parser.parse(
"""
[Global, Exposed=Foo]
[Global=Foo, Exposed=Foo]
interface Foo {
};
[Exposed=Foo]
@ -119,11 +122,30 @@ def WebIDLTest(parser, harness):
};
"""
)
results = parser.finish()
except:
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(
threw,
"Should have thrown for [Global] used on an interface with a " "descendant",
)
parser = parser.reset()
threw = False
try:
parser.parse(
"""
[Global, Exposed=Foo]
interface Foo {
};
"""
)
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(
threw,
"Should have thrown for [Global] without a right hand side value",
)