diff options
author | Marvin Hagemeister <marvin@deno.com> | 2024-05-15 17:08:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 17:08:25 +0200 |
commit | e02d0faedccf4c9147d9cf82e488273bd9d4d45f (patch) | |
tree | c8ff51fa910de2f3c9041d98f8abbe5f463f48e9 /ext/node/polyfills/worker_threads.ts | |
parent | e661591e7c43c907f39dac7d2cc94efd71e57089 (diff) |
fix(node): wrong `worker_threads.terminate()` return value (#23803)
<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/contributing
1. Give the PR a descriptive title.
Examples of good title:
- fix(std/http): Fix race condition in server
- docs(console): Update docstrings
- feat(doc): Handle nested reexports
Examples of bad title:
- fix #7123
- update docs
- fix bugs
2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->
Fixes https://github.com/denoland/deno/issues/23801
---------
Signed-off-by: Marvin Hagemeister <marvinhagemeister50@gmail.com>
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/node/polyfills/worker_threads.ts')
-rw-r--r-- | ext/node/polyfills/worker_threads.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/node/polyfills/worker_threads.ts b/ext/node/polyfills/worker_threads.ts index 71999dd62..36314675a 100644 --- a/ext/node/polyfills/worker_threads.ts +++ b/ext/node/polyfills/worker_threads.ts @@ -32,6 +32,7 @@ import process from "node:process"; const { JSONParse, JSONStringify, ObjectPrototypeIsPrototypeOf } = primordials; const { Error, + PromiseResolve, Symbol, SymbolFor, SymbolIterator, @@ -280,7 +281,8 @@ class NodeWorker extends EventEmitter { this.#status = "TERMINATED"; op_host_terminate_worker(this.#id); } - this.emit("exit", 1); + this.emit("exit", 0); + return PromiseResolve(0); } ref() { |