mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
events: no stopPropagation call in cancelBubble
PR-URL: https://github.com/nodejs/node/pull/50405 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
1 parent
6bf148e12b
commit
d9b5cd533c
2 files changed
+8
-1
No files matched your search
@@ -310,7 +310,7 @@ class Event {
|
||||
if (!isEvent(this))
|
||||
throw new ERR_INVALID_THIS('Event');
|
||||
if (value) {
|
||||
this.stopPropagation();
|
||||
this.#propagationStopped = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -738,3 +738,10 @@ let asyncTest = Promise.resolve();
|
||||
controller.abort();
|
||||
et.dispatchEvent(new Event('foo'));
|
||||
}
|
||||
|
||||
{
|
||||
const event = new Event('foo');
|
||||
strictEqual(event.cancelBubble, false);
|
||||
event.cancelBubble = true;
|
||||
strictEqual(event.cancelBubble, true);
|
||||
}
|
||||
Reference in new issue
Block a user