Skip to content

Commit

Permalink
event: cancelBubble is a property
Browse files Browse the repository at this point in the history
Event#cancelBubble is property (and not a function). Change
Event#cancelBubble to a property and add a test.

PR-URL: nodejs#33613
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
benjamingr authored and Benjamin Gruenbaum committed Jun 21, 2020
1 parent fdf10ad commit 3fff349
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parallel/test-eventtarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ ok(EventTarget);
const ev = new Event('foo', {}, {});
strictEqual(ev.type, 'foo');
}
{
const ev = new Event('foo');
strictEqual(ev.cancelBubble, false);
ev.cancelBubble = true;
strictEqual(ev.cancelBubble, true);
}
{
const ev = new Event('foo');
strictEqual(ev.cancelBubble, false);
ev.stopPropagation();
strictEqual(ev.cancelBubble, true);
}
{
const ev = new Event('foo');
strictEqual(ev.cancelBubble, false);
ev.cancelBubble = 'some-truthy-value';
strictEqual(ev.cancelBubble, true);
}
{
const ev = new Event('foo', { cancelable: true });
strictEqual(ev.type, 'foo');
Expand Down

0 comments on commit 3fff349

Please sign in to comment.