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 @@ -385,6 +385,7 @@ const ev = new Event('foo');
385
385
{
386
386
const target = new EventTarget ( ) ;
387
387
const event = new Event ( 'foo' ) ;
388
+ strictEqual ( event . target , null ) ;
388
389
target . addEventListener ( 'foo' , common . mustCall ( ( event ) => {
389
390
strictEqual ( event . target , target ) ;
390
391
strictEqual ( event . currentTarget , target ) ;
You can’t perform that action at this time.
0 commit comments