File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ class Event {
6060 enumerable : true ,
6161 configurable : false
6262 } ) ;
63+ this [ kTarget ] = null ;
6364 }
6465
6566 [ customInspectSymbol ] ( depth , options ) {
@@ -241,7 +242,7 @@ class EventTarget {
241242 }
242243
243244 if ( this . #emitting. has ( event . type ) ||
244- event [ kTarget ] !== undefined ) {
245+ event [ kTarget ] !== null ) {
245246 throw new ERR_EVENT_RECURSION ( event . type ) ;
246247 }
247248
Original file line number Diff line number Diff line change @@ -370,6 +370,7 @@ ok(EventTarget);
370370{
371371 const target = new EventTarget ( ) ;
372372 const event = new Event ( 'foo' ) ;
373+ strictEqual ( event . target , null ) ;
373374 target . addEventListener ( 'foo' , common . mustCall ( ( event ) => {
374375 strictEqual ( event . target , target ) ;
375376 strictEqual ( event . currentTarget , target ) ;
You can’t perform that action at this time.
0 commit comments