From b3f22d3fdd248e333bb091395f4be3f48dc24733 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 10 Jul 2021 19:43:58 +0530 Subject: [PATCH] fix(extensiosn/web): AddEventListenerOptions.signal shouldn't be nullable (#11348) --- extensions/web/02_event.js | 3 +++ tools/wpt/expectation.json | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) 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": [