Repository navigation
Commit 2137f6b
committed
events: fix getMaxListeners() for NodeEventTarget
events.getMaxListeners() treated any object with a getMaxListeners()
method as an EventEmitter and read `_maxListeners` from it. A
NodeEventTarget, such as a MessagePort, has that method but stores
the value under kMaxEventTargetListeners, so the default was always
returned. Check for the EventTarget value first, in the same order
as events.setMaxListeners().
Fixes: #67916
Assisted-by: a closed-source coding agent
Signed-off-by: Deokjin Kim <deokjin81.kim@gmail.com>1 parent d4318d9 commit 2137f6b
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
963 | | - | |
964 | | - | |
965 | | - | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
966 | 967 | | |
| 968 | + | |
| 969 | + | |
967 | 970 | | |
968 | 971 | | |
969 | 972 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments