diff --git a/extensions/web/02_event.js b/extensions/web/02_event.js index 6b2cc2c047..a8dd95dbd2 100644 --- a/extensions/web/02_event.js +++ b/extensions/web/02_event.js @@ -929,7 +929,10 @@ this.removeEventListener(type, callback, options); }); } + } else if (options?.signal === null) { + throw new TypeError("signal must be non-null"); } + ArrayPrototypePush(listeners[type], { callback, options }); } diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json index f183bb8663..cf03ced803 100644 --- a/tools/wpt/expectation.json +++ b/tools/wpt/expectation.json @@ -1977,9 +1977,7 @@ "event.any.html": true }, "events": { - "AddEventListenerOptions-signal.any.html": [ - "Passing null as the signal should throw" - ], + "AddEventListenerOptions-signal.any.html": true, "Event-isTrusted.any.html": true, "EventTarget-constructible.any.html": true, "Event-constructors.any.html": [