From e02d0faedccf4c9147d9cf82e488273bd9d4d45f Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 15 May 2024 17:08:25 +0200 Subject: fix(node): wrong `worker_threads.terminate()` return value (#23803) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://github.com/denoland/deno/issues/23801 --------- Signed-off-by: Marvin Hagemeister Co-authored-by: Bartek IwaƄczuk --- ext/node/polyfills/worker_threads.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext') 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() { -- cgit v1.2.3