mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05: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:
1 parent
3a682cca03
commit
453df77f99
1 file changed
+1
-1
@@ -200,7 +200,7 @@ class Event {
|
||||
get currentTarget() {
|
||||
if (!isEvent(this))
|
||||
throw new ERR_INVALID_THIS('Event');
|
||||
return this[kTarget];
|
||||
return this[kIsBeingDispatched] ? this[kTarget] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user