-
-
Notifications
You must be signed in to change notification settings - Fork 616
Open
Description
AbortSignal is an EventTarget, so addEventListener() should not throw just because the event name is something other than "abort".
Right now Boa throws a TypeError here:
const ctrl = new AbortController();
ctrl.signal.addEventListener("whatever", () => {});Current result:
TypeError: AbortSignal only supports the 'abort' event typeExpected behavior:
- no throw
- the listener is just never fired, since
AbortSignalonly dispatchesabort
This looks like a small conformance bug in the current AbortSignal implementation. removeEventListener() already quietly ignores unknown event names, so addEventListener() throwing here is also a bit inconsistent with the rest of the API.
Relevant implementation:
core/runtime/src/abort/mod.rs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels