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 @@ -64,6 +64,7 @@ class Event {
6464 enumerable : true ,
6565 configurable : false
6666 } ) ;
67+ this [ kTarget ] = null ;
6768 }
6869
6970 [ customInspectSymbol ] ( depth , options ) {
@@ -245,7 +246,7 @@ class EventTarget {
245246 }
246247
247248 if ( this . #emitting. has ( event . type ) ||
248- event [ kTarget ] !== undefined ) {
249+ event [ kTarget ] !== null ) {
249250 throw new ERR_EVENT_RECURSION ( event . type ) ;
250251 }
251252
Original file line number Diff line number Diff line change @@ -379,6 +379,7 @@ ok(EventTarget);
379379{
380380 const target = new EventTarget ( ) ;
381381 const event = new Event ( 'foo' ) ;
382+ strictEqual ( event . target , null ) ;
382383 target . addEventListener ( 'foo' , common . mustCall ( ( event ) => {
383384 strictEqual ( event . target , target ) ;
384385 strictEqual ( event . currentTarget , target ) ;
You can’t perform that action at this time.
0 commit comments