Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2724514

Browse files
benjamingrcodebytere
authored andcommittedJun 27, 2020
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: #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]> PR-URL: #34015 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 91b6c09 commit 2724514

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
@@ -70,6 +70,24 @@ ok(EventTarget);
7070
const ev = new Event('foo', {}, {});
7171
strictEqual(ev.type, 'foo');
7272
}
73+
{
74+
const ev = new Event('foo');
75+
strictEqual(ev.cancelBubble, false);
76+
ev.cancelBubble = true;
77+
strictEqual(ev.cancelBubble, true);
78+
}
79+
{
80+
const ev = new Event('foo');
81+
strictEqual(ev.cancelBubble, false);
82+
ev.stopPropagation();
83+
strictEqual(ev.cancelBubble, true);
84+
}
85+
{
86+
const ev = new Event('foo');
87+
strictEqual(ev.cancelBubble, false);
88+
ev.cancelBubble = 'some-truthy-value';
89+
strictEqual(ev.cancelBubble, true);
90+
}
7391
{
7492
const ev = new Event('foo', { cancelable: true });
7593
strictEqual(ev.type, 'foo');

0 commit comments

Comments
 (0)
Please sign in to comment.