Skip to content

Commit

Permalink
events: no stopPropagation call in cancelBubble
Browse files Browse the repository at this point in the history
PR-URL: #50405
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
mert.altin authored and marco-ippolito committed Feb 27, 2024
1 parent ec17fd7 commit 78f8180
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/event_target.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class Event {
if (!isEvent(this))
throw new ERR_INVALID_THIS('Event');
if (value) {
this.stopPropagation();
this.#propagationStopped = true;
}
}

Expand Down
7 changes: 7 additions & 0 deletions test/parallel/test-eventtarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 78f8180

Please sign in to comment.