script: implement AbortController (#31361)

* Implement AbortController

Signed-off-by: syvb <me@iter.ca>

* Update WPT tests

Signed-off-by: syvb <me@iter.ca>

* Address review comments

* Fix duplicate import generation

* Update WPT test expectations

* Change expectation to FAIL for flaky test

---------

Signed-off-by: syvb <me@iter.ca>
This commit is contained in:
Smitty 2024-05-04 11:00:01 -04:00 committed by GitHub
parent 383607d01e
commit 7fce850cff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
88 changed files with 522 additions and 1194 deletions

View file

@ -2167,7 +2167,8 @@ class CGImports(CGWrapper):
"""
Generates the appropriate import/use statements.
"""
def __init__(self, child, descriptors, callbacks, dictionaries, enums, typedefs, imports, config):
def __init__(self, child, descriptors, callbacks, dictionaries, enums, typedefs, imports, config,
current_name=None):
"""
Adds a set of imports.
"""
@ -2269,7 +2270,8 @@ class CGImports(CGWrapper):
parentName = descriptor.getParentName()
while parentName:
descriptor = descriptorProvider.getDescriptor(parentName)
extras += [descriptor.path, descriptor.bindingPath]
if current_name != descriptor.ifaceName:
extras += [descriptor.path, descriptor.bindingPath]
parentName = descriptor.getParentName()
elif t.isType() and t.isRecord():
extras += ['crate::dom::bindings::record::Record']
@ -6890,7 +6892,7 @@ class CGBindingRoot(CGThing):
DomRoot codegen class for binding generation. Instantiate the class, and call
declare or define to generate header or cpp code (respectively).
"""
def __init__(self, config, prefix, webIDLFile):
def __init__(self, config, prefix, webIDLFile, name):
descriptors = config.getDescriptors(webIDLFile=webIDLFile,
hasInterfaceObject=True)
# We also want descriptors that have an interface prototype object
@ -6958,7 +6960,7 @@ class CGBindingRoot(CGThing):
# These are the global imports (outside of the generated module)
curr = CGImports(curr, descriptors=callbackDescriptors, callbacks=mainCallbacks,
dictionaries=dictionaries, enums=enums, typedefs=typedefs,
imports=['crate::dom::bindings::import::base::*'], config=config)
imports=['crate::dom::bindings::import::base::*'], config=config, current_name=name)
# Add the auto-generated comment.
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT + ALLOWED_WARNINGS)