File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ class EventTarget {
722722 return ;
723723
724724 type = webidl . converters . DOMString ( type ) ;
725- const capture = options ?. capture === true ;
725+ const capture = typeof options === 'boolean' ? options : options ?. capture === true ;
726726
727727 if ( this [ kEvents ] === undefined )
728728 return ;
Original file line number Diff line number Diff line change @@ -419,6 +419,20 @@ let asyncTest = Promise.resolve();
419419 target . removeEventListener ( 'foo' , a , { capture : false } ) ;
420420 target . dispatchEvent ( new Event ( 'foo' ) ) ;
421421}
422+
423+ {
424+ const target = new EventTarget ( ) ;
425+ const a = common . mustCall ( 3 ) ;
426+
427+ target . addEventListener ( 'foo' , a , true ) ;
428+ target . addEventListener ( 'foo' , a , false ) ;
429+
430+ target . dispatchEvent ( new Event ( 'foo' ) ) ;
431+ target . removeEventListener ( 'foo' , a , true ) ;
432+ target . dispatchEvent ( new Event ( 'foo' ) ) ;
433+ target . removeEventListener ( 'foo' , a , false ) ;
434+ target . dispatchEvent ( new Event ( 'foo' ) ) ;
435+ }
422436{
423437 const target = new EventTarget ( ) ;
424438 assert . strictEqual ( target . toString ( ) , '[object EventTarget]' ) ;
You can’t perform that action at this time.
0 commit comments