Skip to content

Commit 453df77

Browse files
KhafraDevmarco-ippolito
authored andcommitted
events: return currentTarget when dispatching
PR-URL: #54642 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 3a682cc commit 453df77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/event_target.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class Event {
200200
get currentTarget() {
201201
if (!isEvent(this))
202202
throw new ERR_INVALID_THIS('Event');
203-
return this[kTarget];
203+
return this[kIsBeingDispatched] ? this[kTarget] : null;
204204
}
205205

206206
/**

0 commit comments

Comments
 (0)