File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ class Event {
64
64
enumerable : true ,
65
65
configurable : false
66
66
} ) ;
67
+ this [ kTarget ] = null ;
67
68
}
68
69
69
70
[ customInspectSymbol ] ( depth , options ) {
@@ -245,7 +246,7 @@ class EventTarget {
245
246
}
246
247
247
248
if ( this . #emitting. has ( event . type ) ||
248
- event [ kTarget ] !== undefined ) {
249
+ event [ kTarget ] !== null ) {
249
250
throw new ERR_EVENT_RECURSION ( event . type ) ;
250
251
}
251
252
Original file line number Diff line number Diff line change @@ -379,6 +379,7 @@ ok(EventTarget);
379
379
{
380
380
const target = new EventTarget ( ) ;
381
381
const event = new Event ( 'foo' ) ;
382
+ strictEqual ( event . target , null ) ;
382
383
target . addEventListener ( 'foo' , common . mustCall ( ( event ) => {
383
384
strictEqual ( event . target , target ) ;
384
385
strictEqual ( event . currentTarget , target ) ;
You can’t perform that action at this time.
0 commit comments