Commit 43acce1
worker: handle calling terminate when kHandler is null
This PR makes a change to the Worker.terminate() when called if the
kHandler is null. Before this pull request it was returning undefined,
but the API is expecting a promise. With the changes in this PR if
terminate is called a Promise.resolve() is returned, unless a callback
is passed in which case the old behavior stays (returns undefined).
PR-URL: #28370
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 464136f commit 43acce1Copy full SHA for 43acce1
File tree
Expand file treeCollapse file tree
2 files changed
+30
-2
lines changedOpen diff view settings
Filter options
- lib/internal
- test/parallel
Expand file treeCollapse file tree
2 files changed
+30
-2
lines changedOpen diff view settings
Collapse file
+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
224 | 224 | |
225 | 225 | |
226 | 226 | |
227 | | - |
228 | | - |
229 | 227 | |
230 | 228 | |
231 | 229 | |
232 | 230 | |
233 | 231 | |
234 | 232 | |
235 | 233 | |
| 234 | + |
236 | 235 | |
237 | 236 | |
238 | 237 | |
| 238 | + |
| 239 | + |
239 | 240 | |
240 | 241 | |
241 | 242 | |
|
Collapse file
test/parallel/test-worker-terminate-null-handler.js
Copy file name to clipboard+27Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
0 commit comments