From e87ed58a175bfa0c017354abcb581eb05ba8c97a Mon Sep 17 00:00:00 2001 From: Jacob Powell Date: Tue, 5 Dec 2023 21:51:19 -0800 Subject: [PATCH] events: unlink stopPropagation and cancelBubble methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WHATWG spec does not define any explicit relationship between stopPropagation and cancelBubble, the methods' responsibilities are simply to "set this’s stop propagation flag" under varying circumstances. Fixes: https://github.com/nodejs/node/issues/50401 --- lib/internal/event_target.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 4c67453fea4c59..d1b0af7317085d 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -306,7 +306,7 @@ class Event { if (!isEvent(this)) throw new ERR_INVALID_THIS('Event'); if (value) { - this.stopPropagation(); + this.#propagationStopped = true; } }