mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
events: return currentTarget
when dispatching
PR-URL: https://github.com/nodejs/node/pull/54642 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
c6ae161237
commit
0de1cf004c
1 changed files with 1 additions and 1 deletions
|
@ -196,7 +196,7 @@ class Event {
|
|||
get currentTarget() {
|
||||
if (!isEvent(this))
|
||||
throw new ERR_INVALID_THIS('Event');
|
||||
return this[kTarget];
|
||||
return this[kIsBeingDispatched] ? this[kTarget] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue