Skip to content

Commit 3fff349

Browse files
benjamingrBenjamin Gruenbaum
authored and
Benjamin Gruenbaum
committed
event: cancelBubble is a property
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 <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]>
1 parent fdf10ad commit 3fff349

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/parallel/test-eventtarget.js

+18
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ ok(EventTarget);
6969
const ev = new Event('foo', {}, {});
7070
strictEqual(ev.type, 'foo');
7171
}
72+
{
73+
const ev = new Event('foo');
74+
strictEqual(ev.cancelBubble, false);
75+
ev.cancelBubble = true;
76+
strictEqual(ev.cancelBubble, true);
77+
}
78+
{
79+
const ev = new Event('foo');
80+
strictEqual(ev.cancelBubble, false);
81+
ev.stopPropagation();
82+
strictEqual(ev.cancelBubble, true);
83+
}
84+
{
85+
const ev = new Event('foo');
86+
strictEqual(ev.cancelBubble, false);
87+
ev.cancelBubble = 'some-truthy-value';
88+
strictEqual(ev.cancelBubble, true);
89+
}
7290
{
7391
const ev = new Event('foo', { cancelable: true });
7492
strictEqual(ev.type, 'foo');

0 commit comments

Comments
 (0)