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 @@ -60,6 +60,7 @@ class Event {
60
60
enumerable : true ,
61
61
configurable : false
62
62
} ) ;
63
+ this [ kTarget ] = null ;
63
64
}
64
65
65
66
[ customInspectSymbol ] ( depth , options ) {
@@ -241,7 +242,7 @@ class EventTarget {
241
242
}
242
243
243
244
if ( this . #emitting. has ( event . type ) ||
244
- event [ kTarget ] !== undefined ) {
245
+ event [ kTarget ] !== null ) {
245
246
throw new ERR_EVENT_RECURSION ( event . type ) ;
246
247
}
247
248
Original file line number Diff line number Diff line change @@ -370,6 +370,7 @@ ok(EventTarget);
370
370
{
371
371
const target = new EventTarget ( ) ;
372
372
const event = new Event ( 'foo' ) ;
373
+ strictEqual ( event . target , null ) ;
373
374
target . addEventListener ( 'foo' , common . mustCall ( ( event ) => {
374
375
strictEqual ( event . target , target ) ;
375
376
strictEqual ( event . currentTarget , target ) ;
You can’t perform that action at this time.
0 commit comments