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

@ -1,5 +1,62 @@
[abort-signal-any.any.worker.html]
expected: ERROR
[AbortSignal.any() works with an empty array of signals]
expected: FAIL
[AbortSignal.any() follows a single signal (using AbortController)]
expected: FAIL
[AbortSignal.any() follows multiple signals (using AbortController)]
expected: FAIL
[AbortSignal.any() returns an aborted signal if passed an aborted signal (using AbortController)]
expected: FAIL
[AbortSignal.any() can be passed the same signal more than once (using AbortController)]
expected: FAIL
[AbortSignal.any() uses the first instance of a duplicate signal (using AbortController)]
expected: FAIL
[AbortSignal.any() signals are composable (using AbortController)]
expected: FAIL
[AbortSignal.any() works with signals returned by AbortSignal.timeout() (using AbortController)]
expected: FAIL
[AbortSignal.any() works with intermediate signals (using AbortController)]
expected: FAIL
[Abort events for AbortSignal.any() signals fire in the right order (using AbortController)]
expected: FAIL
[abort-signal-any.any.html]
expected: ERROR
[AbortSignal.any() works with an empty array of signals]
expected: FAIL
[AbortSignal.any() follows a single signal (using AbortController)]
expected: FAIL
[AbortSignal.any() follows multiple signals (using AbortController)]
expected: FAIL
[AbortSignal.any() returns an aborted signal if passed an aborted signal (using AbortController)]
expected: FAIL
[AbortSignal.any() can be passed the same signal more than once (using AbortController)]
expected: FAIL
[AbortSignal.any() uses the first instance of a duplicate signal (using AbortController)]
expected: FAIL
[AbortSignal.any() signals are composable (using AbortController)]
expected: FAIL
[AbortSignal.any() works with signals returned by AbortSignal.timeout() (using AbortController)]
expected: FAIL
[AbortSignal.any() works with intermediate signals (using AbortController)]
expected: FAIL
[Abort events for AbortSignal.any() signals fire in the right order (using AbortController)]
expected: FAIL

View file

@ -1,31 +1,7 @@
[event.any.html]
[AbortController abort() should fire event synchronously]
expected: FAIL
[controller.signal should always return the same object]
expected: FAIL
[controller.abort() should do nothing the second time it is called]
expected: FAIL
[event handler should not be called if added after controller.abort()]
expected: FAIL
[the abort event should have the right properties]
expected: FAIL
[AbortController abort(reason) should set signal.reason]
expected: FAIL
[aborting AbortController without reason creates an "AbortError" DOMException]
expected: FAIL
[AbortController abort(undefined) creates an "AbortError" DOMException]
expected: FAIL
[AbortController abort(null) should set signal.reason]
expected: FAIL
[static aborting signal should have right properties]
expected: FAIL
@ -38,44 +14,14 @@
[throwIfAborted() should throw primitive abort.reason if signal aborted]
expected: FAIL
[throwIfAborted() should not throw if signal not aborted]
expected: FAIL
[AbortSignal.reason returns the same DOMException]
expected: FAIL
[AbortController.signal.reason returns the same DOMException]
expected: FAIL
[event.any.worker.html]
[AbortController abort() should fire event synchronously]
expected: FAIL
[controller.signal should always return the same object]
expected: FAIL
[controller.abort() should do nothing the second time it is called]
expected: FAIL
[event handler should not be called if added after controller.abort()]
expected: FAIL
[the abort event should have the right properties]
expected: FAIL
[AbortController abort(reason) should set signal.reason]
expected: FAIL
[aborting AbortController without reason creates an "AbortError" DOMException]
expected: FAIL
[AbortController abort(undefined) creates an "AbortError" DOMException]
expected: FAIL
[AbortController abort(null) should set signal.reason]
expected: FAIL
[static aborting signal should have right properties]
expected: FAIL
@ -88,11 +34,5 @@
[throwIfAborted() should throw primitive abort.reason if signal aborted]
expected: FAIL
[throwIfAborted() should not throw if signal not aborted]
expected: FAIL
[AbortSignal.reason returns the same DOMException]
expected: FAIL
[AbortController.signal.reason returns the same DOMException]
expected: FAIL

View file

@ -1,68 +1,14 @@
[AddEventListenerOptions-signal.any.html]
[Passing an AbortSignal to addEventListener works with the once flag]
expected: FAIL
[Adding then aborting a listener in another listener does not call it]
expected: FAIL
[Passing an AbortSignal to addEventListener works with the capture flag]
expected: FAIL
[Aborting from a listener does not call future listeners]
expected: FAIL
[Passing an AbortSignal to multiple listeners]
expected: FAIL
[Passing an AbortSignal to addEventListener does not prevent removeEventListener]
expected: FAIL
[Aborting from a nested listener should remove it]
expected: FAIL
[Removing a once listener works with a passed signal]
expected: FAIL
[Passing an AbortSignal to addEventListener options should allow removing a listener]
expected: FAIL
[Passing null as the signal should throw]
expected: FAIL
[Passing null as the signal should throw (listener is also null)]
expected: FAIL
[AddEventListenerOptions-signal.any.worker.html]
[Passing an AbortSignal to addEventListener works with the once flag]
expected: FAIL
[Adding then aborting a listener in another listener does not call it]
expected: FAIL
[Passing an AbortSignal to addEventListener works with the capture flag]
expected: FAIL
[Aborting from a listener does not call future listeners]
expected: FAIL
[Passing an AbortSignal to multiple listeners]
expected: FAIL
[Passing an AbortSignal to addEventListener does not prevent removeEventListener]
expected: FAIL
[Aborting from a nested listener should remove it]
expected: FAIL
[Removing a once listener works with a passed signal]
expected: FAIL
[Passing an AbortSignal to addEventListener options should allow removing a listener]
expected: FAIL
[Passing null as the signal should throw]
expected: FAIL
[Passing null as the signal should throw (listener is also null)]
expected: FAIL

View file

@ -17,146 +17,32 @@
[Event interface: new CustomEvent("foo") must inherit property "composed" with the proper type]
expected: FAIL
[AbortController interface: existence and properties of interface object]
expected: FAIL
[AbortController interface object length]
expected: FAIL
[AbortController interface object name]
expected: FAIL
[AbortController interface: existence and properties of interface prototype object]
expected: FAIL
[AbortController interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[AbortController interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[AbortController interface: attribute signal]
expected: FAIL
[AbortController interface: operation abort()]
expected: FAIL
[AbortController must be primary interface of new AbortController()]
expected: FAIL
[Stringification of new AbortController()]
expected: FAIL
[AbortController interface: new AbortController() must inherit property "signal" with the proper type]
expected: FAIL
[AbortController interface: new AbortController() must inherit property "abort()" with the proper type]
expected: FAIL
[AbortSignal interface: existence and properties of interface object]
expected: FAIL
[AbortSignal interface object length]
expected: FAIL
[AbortSignal interface object name]
expected: FAIL
[AbortSignal interface: existence and properties of interface prototype object]
expected: FAIL
[AbortSignal interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[AbortSignal interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[AbortSignal interface: operation abort()]
expected: FAIL
[AbortSignal interface: attribute aborted]
expected: FAIL
[AbortSignal interface: attribute onabort]
expected: FAIL
[AbortSignal must be primary interface of new AbortController().signal]
expected: FAIL
[Stringification of new AbortController().signal]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "abort()" with the proper type]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "aborted" with the proper type]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "onabort" with the proper type]
expected: FAIL
[EventTarget interface: new AbortController().signal must inherit property "addEventListener(DOMString, EventListener?, optional (AddEventListenerOptions or boolean))" with the proper type]
expected: FAIL
[EventTarget interface: calling addEventListener(DOMString, EventListener?, optional (AddEventListenerOptions or boolean)) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[EventTarget interface: new AbortController().signal must inherit property "removeEventListener(DOMString, EventListener?, optional (EventListenerOptions or boolean))" with the proper type]
expected: FAIL
[EventTarget interface: calling removeEventListener(DOMString, EventListener?, optional (EventListenerOptions or boolean)) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[EventTarget interface: new AbortController().signal must inherit property "dispatchEvent(Event)" with the proper type]
expected: FAIL
[EventTarget interface: calling dispatchEvent(Event) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[AbortController interface: operation abort(optional any)]
expected: FAIL
[AbortController interface: new AbortController() must inherit property "abort(optional any)" with the proper type]
expected: FAIL
[AbortController interface: calling abort(optional any) on new AbortController() with too few arguments must throw TypeError]
expected: FAIL
[AbortSignal interface: operation abort(optional any)]
expected: FAIL
[AbortSignal interface: attribute reason]
expected: FAIL
[AbortSignal interface: operation throwIfAborted()]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "abort(optional any)" with the proper type]
expected: FAIL
[AbortSignal interface: calling abort(optional any) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "reason" with the proper type]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "throwIfAborted()" with the proper type]
expected: FAIL
[AbortSignal interface: operation timeout(unsigned long long)]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "timeout(unsigned long long)" with the proper type]
expected: FAIL
[AbortSignal interface: calling timeout(unsigned long long) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[AbortSignal interface: operation any(sequence<AbortSignal>)]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "any(sequence<AbortSignal>)" with the proper type]
expected: FAIL
[AbortSignal interface: calling any(sequence<AbortSignal>) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL

View file

@ -28,18 +28,12 @@
[XPathEvaluator interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[AbortSignal must be primary interface of new AbortController().signal]
expected: FAIL
[XPathResult interface: constant NUMBER_TYPE on interface object]
expected: FAIL
[Element interface: element must inherit property "assignedSlot" with the proper type]
expected: FAIL
[AbortController interface object name]
expected: FAIL
[Text interface: document.createTextNode("abc") must inherit property "assignedSlot" with the proper type]
expected: FAIL
@ -52,15 +46,9 @@
[Text interface: attribute assignedSlot]
expected: FAIL
[AbortSignal interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[Document interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[AbortSignal interface: existence and properties of interface object]
expected: FAIL
[XPathResult interface: constant STRING_TYPE on interface prototype object]
expected: FAIL
@ -70,27 +58,12 @@
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "ORDERED_NODE_ITERATOR_TYPE" with the proper type]
expected: FAIL
[EventTarget interface: calling removeEventListener(DOMString, EventListener?, optional (EventListenerOptions or boolean)) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[EventTarget interface: new AbortController().signal must inherit property "addEventListener(DOMString, EventListener?, optional (AddEventListenerOptions or boolean))" with the proper type]
expected: FAIL
[EventTarget interface: new AbortController().signal must inherit property "dispatchEvent(Event)" with the proper type]
expected: FAIL
[AbortSignal interface object name]
expected: FAIL
[Event interface: new CustomEvent("foo") must inherit property "composed" with the proper type]
expected: FAIL
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "UNORDERED_NODE_ITERATOR_TYPE" with the proper type]
expected: FAIL
[EventTarget interface: new AbortController().signal must inherit property "removeEventListener(DOMString, EventListener?, optional (EventListenerOptions or boolean))" with the proper type]
expected: FAIL
[Element interface: operation attachShadow(ShadowRootInit)]
expected: FAIL
@ -106,9 +79,6 @@
[AbortController interface: operation abort()]
expected: FAIL
[AbortController interface: existence and properties of interface object]
expected: FAIL
[XPathResult interface: constant UNORDERED_NODE_ITERATOR_TYPE on interface prototype object]
expected: FAIL
@ -118,9 +88,6 @@
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "ANY_UNORDERED_NODE_TYPE" with the proper type]
expected: FAIL
[AbortController interface: attribute signal]
expected: FAIL
[XPathResult interface: constant UNORDERED_NODE_SNAPSHOT_TYPE on interface prototype object]
expected: FAIL
@ -136,9 +103,6 @@
[CharacterData interface: operation before((Node or DOMString)...)]
expected: FAIL
[AbortSignal interface: attribute aborted]
expected: FAIL
[XPathResult interface: operation snapshotItem(unsigned long)]
expected: FAIL
@ -154,12 +118,6 @@
[Element interface: operation after((Node or DOMString)...)]
expected: FAIL
[AbortController must be primary interface of new AbortController()]
expected: FAIL
[AbortController interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[Element interface: attribute assignedSlot]
expected: FAIL
@ -205,9 +163,6 @@
[XPathExpression interface: operation evaluate(Node, optional unsigned short, optional XPathResult?)]
expected: FAIL
[AbortController interface: new AbortController() must inherit property "signal" with the proper type]
expected: FAIL
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "iterateNext()" with the proper type]
expected: FAIL
@ -232,9 +187,6 @@
[Document interface: calling evaluate(DOMString, Node, optional XPathNSResolver?, optional unsigned short, optional XPathResult?) on new Document() with too few arguments must throw TypeError]
expected: FAIL
[AbortController interface object length]
expected: FAIL
[XPathExpression interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
@ -265,15 +217,9 @@
[DocumentType interface: operation replaceWith((Node or DOMString)...)]
expected: FAIL
[EventTarget interface: calling dispatchEvent(Event) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[XPathResult interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[AbortController interface: existence and properties of interface prototype object]
expected: FAIL
[Document interface: new Document() must inherit property "createNSResolver(Node)" with the proper type]
expected: FAIL
@ -310,12 +256,6 @@
[XPathResult interface: constant ORDERED_NODE_SNAPSHOT_TYPE on interface prototype object]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "aborted" with the proper type]
expected: FAIL
[EventTarget interface: calling addEventListener(DOMString, EventListener?, optional (AddEventListenerOptions or boolean)) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[Document interface: calling createExpression(DOMString, optional XPathNSResolver?) on xmlDoc with too few arguments must throw TypeError]
expected: FAIL
@ -331,36 +271,24 @@
[XPathEvaluator interface object length]
expected: FAIL
[AbortSignal interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[XPathEvaluator interface: new XPathEvaluator() must inherit property "evaluate(DOMString, Node, optional XPathNSResolver?, optional unsigned short, optional XPathResult?)" with the proper type]
expected: FAIL
[XPathEvaluator interface: calling evaluate(DOMString, Node, optional XPathNSResolver?, optional unsigned short, optional XPathResult?) on new XPathEvaluator() with too few arguments must throw TypeError]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "onabort" with the proper type]
expected: FAIL
[Document interface: calling evaluate(DOMString, Node, optional XPathNSResolver?, optional unsigned short, optional XPathResult?) on xmlDoc with too few arguments must throw TypeError]
expected: FAIL
[XPathResult interface: constant UNORDERED_NODE_SNAPSHOT_TYPE on interface object]
expected: FAIL
[AbortController interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "stringValue" with the proper type]
expected: FAIL
[XPathResult interface: attribute invalidIteratorState]
expected: FAIL
[AbortSignal interface: attribute onabort]
expected: FAIL
[Document interface: operation evaluate(DOMString, Node, optional XPathNSResolver?, optional unsigned short, optional XPathResult?)]
expected: FAIL
@ -370,15 +298,9 @@
[Document interface: operation createExpression(DOMString, optional XPathNSResolver?)]
expected: FAIL
[AbortSignal interface object length]
expected: FAIL
[XPathEvaluator interface: calling createNSResolver(Node) on new XPathEvaluator() with too few arguments must throw TypeError]
expected: FAIL
[AbortSignal interface: existence and properties of interface prototype object]
expected: FAIL
[XPathResult interface: attribute numberValue]
expected: FAIL
@ -430,9 +352,6 @@
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "ORDERED_NODE_SNAPSHOT_TYPE" with the proper type]
expected: FAIL
[Stringification of new AbortController().signal]
expected: FAIL
[XPathResult interface: constant ANY_UNORDERED_NODE_TYPE on interface prototype object]
expected: FAIL
@ -469,9 +388,6 @@
[XPathResult interface: document.evaluate("//*", document.body) must inherit property "FIRST_ORDERED_NODE_TYPE" with the proper type]
expected: FAIL
[Stringification of new AbortController()]
expected: FAIL
[XPathExpression interface: calling evaluate(Node, optional unsigned short, optional XPathResult?) on document.createExpression("//*") with too few arguments must throw TypeError]
expected: FAIL
@ -637,45 +553,18 @@
[XSLTProcessor interface: new XSLTProcessor() must inherit property "reset()" with the proper type]
expected: FAIL
[AbortController interface: operation abort(optional any)]
expected: FAIL
[AbortController interface: new AbortController() must inherit property "abort(optional any)" with the proper type]
expected: FAIL
[AbortController interface: calling abort(optional any) on new AbortController() with too few arguments must throw TypeError]
expected: FAIL
[AbortSignal interface: operation abort(optional any)]
expected: FAIL
[AbortSignal interface: attribute reason]
expected: FAIL
[AbortSignal interface: operation throwIfAborted()]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "abort(optional any)" with the proper type]
expected: FAIL
[AbortSignal interface: calling abort(optional any) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "reason" with the proper type]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "throwIfAborted()" with the proper type]
expected: FAIL
[idl_test setup]
expected: FAIL
[AbortSignal interface: operation timeout(unsigned long long)]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "timeout(unsigned long long)" with the proper type]
expected: FAIL
[AbortSignal interface: calling timeout(unsigned long long) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL
@ -712,9 +601,6 @@
[AbortSignal interface: operation any(sequence<AbortSignal>)]
expected: FAIL
[AbortSignal interface: new AbortController().signal must inherit property "any(sequence<AbortSignal>)" with the proper type]
expected: FAIL
[AbortSignal interface: calling any(sequence<AbortSignal>) on new AbortController().signal with too few arguments must throw TypeError]
expected: FAIL

View file

@ -1,6 +0,0 @@
[interface-objects.html]
[Should be able to delete AbortController.]
expected: FAIL
[Should be able to delete AbortSignal.]
expected: FAIL