Commit 127439d
process: make tick callback and promise rejection callback more robust
- Rename `internalTickCallback` to `processTicksAndRejections`, make
sure it does not get called if it's not set in C++.
- Rename `emitPromiseRejectionWarnings` to `processPromiseRejections`
since it also emit events that are not warnings.
- Sets `SetPromiseRejectCallback` in the `Environment` constructor
to make sure it only gets called once per-isolate, and make
sure it does not get called if it's not set in C++.
- Wrap promise rejection callback initialization into
`listenForRejections()`.
- Add comments.
PR-URL: #25200
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent abc4cc2 commit 127439dCopy full SHA for 127439d
File tree
Expand file treeCollapse file tree
9 files changed
+50
-32
lines changedOpen diff view settings
Filter options
- lib/internal/process
- src
- test/message
Expand file treeCollapse file tree
9 files changed
+50
-32
lines changedOpen diff view settings
Collapse file
lib/internal/process/next_tick.js
Copy file name to clipboardExpand all lines: lib/internal/process/next_tick.js+9-11Lines changed: 9 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
9 | | - |
10 | | - |
| 9 | + |
11 | 10 | |
12 | 11 | |
13 | 12 | |
14 | 13 | |
15 | 14 | |
16 | | - |
17 | | - |
| 15 | + |
| 16 | + |
18 | 17 | |
19 | 18 | |
20 | 19 | |
| ||
49 | 48 | |
50 | 49 | |
51 | 50 | |
52 | | - |
| 51 | + |
53 | 52 | |
54 | 53 | |
55 | | - |
| 54 | + |
56 | 55 | |
57 | 56 | |
58 | 57 | |
| ||
80 | 79 | |
81 | 80 | |
82 | 81 | |
83 | | - |
| 82 | + |
84 | 83 | |
85 | 84 | |
86 | 85 | |
| ||
134 | 133 | |
135 | 134 | |
136 | 135 | |
137 | | - |
138 | | - |
139 | | - |
| 136 | + |
| 137 | + |
140 | 138 | |
141 | | - |
| 139 | + |
142 | 140 | |
143 | 141 | |
144 | 142 | |
|
Collapse file
lib/internal/process/promises.js
Copy file name to clipboardExpand all lines: lib/internal/process/promises.js+11-4Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
8 | 8 | |
9 | 9 | |
10 | 10 | |
11 | | - |
| 11 | + |
| 12 | + |
12 | 13 | |
13 | 14 | |
14 | 15 | |
| ||
117 | 118 | |
118 | 119 | |
119 | 120 | |
120 | | - |
| 121 | + |
| 122 | + |
| 123 | + |
121 | 124 | |
122 | 125 | |
123 | 126 | |
| ||
142 | 145 | |
143 | 146 | |
144 | 147 | |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
145 | 152 | |
146 | 153 | |
147 | 154 | |
148 | | - |
149 | | - |
| 155 | + |
| 156 | + |
150 | 157 | |
Collapse file
+8-2Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
| 8 | + |
8 | 9 | |
9 | 10 | |
10 | 11 | |
| ||
114 | 115 | |
115 | 116 | |
116 | 117 | |
117 | | - |
118 | | - |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
119 | 125 | |
120 | 126 | |
121 | 127 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
235 | 235 | |
236 | 236 | |
237 | 237 | |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
238 | 242 | |
239 | 243 | |
240 | 244 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
180 | 180 | |
181 | 181 | |
182 | 182 | |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
183 | 187 | |
184 | 188 | |
185 | 189 | |
|
Collapse file
+8-9Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
| 39 | + |
40 | 40 | |
41 | 41 | |
42 | 42 | |
| ||
49 | 49 | |
50 | 50 | |
51 | 51 | |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
52 | 56 | |
53 | 57 | |
54 | 58 | |
| ||
83 | 87 | |
84 | 88 | |
85 | 89 | |
86 | | - |
| 90 | + |
87 | 91 | |
88 | 92 | |
89 | 93 | |
90 | 94 | |
91 | 95 | |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
97 | 96 | |
98 | 97 | |
99 | 98 | |
| ||
120 | 119 | |
121 | 120 | |
122 | 121 | |
123 | | - |
124 | | - |
| 122 | + |
| 123 | + |
125 | 124 | |
126 | 125 | |
127 | 126 | |
|
Collapse file
test/message/events_unhandled_error_nexttick.out
Copy file name to clipboardExpand all lines: test/message/events_unhandled_error_nexttick.out+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | | - |
| 18 | + |
19 | 19 | |
20 | 20 | |
21 | 21 | |
|
Collapse file
test/message/nexttick_throw.out
Copy file name to clipboardExpand all lines: test/message/nexttick_throw.out+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
7 | | - |
| 7 | + |
8 | 8 | |
9 | 9 | |
10 | 10 | |
|
Collapse file
test/message/stdin_messages.out
Copy file name to clipboardExpand all lines: test/message/stdin_messages.out+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
| 15 | + |
16 | 16 | |
17 | 17 | |
18 | 18 | |
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | | - |
| 32 | + |
33 | 33 | |
34 | 34 | |
35 | 35 | |
| ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | | - |
| 47 | + |
48 | 48 | |
49 | 49 | |
50 | 50 | |
| ||
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | | - |
| 63 | + |
64 | 64 | |
65 | 65 | |
66 | 66 | |
|
0 commit comments