Commit 7ace5ab
authored
events: validate options of
Check whether options is object or not to avoid passing
invalid type as options to `on` and `once`.
Refs: https://nodejs.org/dist/latest-v19.x/docs/api/events.html#eventsonceemitter-name-options
PR-URL: #46018
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>on and once
1 parent b3ec13d commit 7ace5abCopy full SHA for 7ace5ab
File tree
Expand file treeCollapse file tree
3 files changed
+20
-10
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+20
-10
lines changedOpen diff view settings
Collapse file
+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
81 | 81 | |
82 | 82 | |
83 | 83 | |
| 84 | + |
84 | 85 | |
85 | 86 | |
86 | 87 | |
| ||
960 | 961 | |
961 | 962 | |
962 | 963 | |
| 964 | + |
963 | 965 | |
964 | 966 | |
965 | 967 | |
| ||
1047 | 1049 | |
1048 | 1050 | |
1049 | 1051 | |
| 1052 | + |
1050 | 1053 | |
1051 | 1054 | |
1052 | 1055 | |
|
Collapse file
test/parallel/test-events-on-async-iterator.js
Copy file name to clipboardExpand all lines: test/parallel/test-events-on-async-iterator.js+9Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
40 | 40 | |
41 | 41 | |
42 | 42 | |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
43 | 52 | |
44 | 53 | |
45 | 54 | |
|
Collapse file
test/parallel/test-events-once.js
Copy file name to clipboardExpand all lines: test/parallel/test-events-once.js+8-10Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
7 | | - |
8 | 7 | |
9 | 8 | |
10 | 9 | |
| 10 | + |
11 | 11 | |
12 | 12 | |
13 | 13 | |
| ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | | - |
| 27 | + |
28 | 28 | |
29 | 29 | |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
36 | 35 | |
37 | 36 | |
38 | | - |
39 | 37 | |
40 | 38 | |
41 | 39 | |
| ||
267 | 265 | |
268 | 266 | |
269 | 267 | |
270 | | - |
| 268 | + |
271 | 269 | |
272 | 270 | |
273 | 271 | |
|
0 commit comments