Skip to content

Commit 37fa3ce

Browse files
committed
Fixing the error in the try catch block
1 parent 7477d0c commit 37fa3ce

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

runtime/js/40_process.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,16 @@ class ChildProcess {
299299
try {
300300
const onAbort = () => this.kill("SIGTERM");
301301
signal?.[abortSignal.add](onAbort);
302+
const waitPromise = op_spawn_wait(this.#rid);
303+
this.#waitPromise = waitPromise;
304+
this.#status = PromisePrototypeThen(waitPromise, (res) => {
305+
signal?.[abortSignal.remove](onAbort);
306+
this.#waitComplete = true;
307+
return res;
308+
});
302309
} catch (e) {
303310
void e;
304311
}
305-
306-
const waitPromise = op_spawn_wait(this.#rid);
307-
this.#waitPromise = waitPromise;
308-
this.#status = PromisePrototypeThen(waitPromise, (res) => {
309-
signal?.[abortSignal.remove](onAbort);
310-
this.#waitComplete = true;
311-
return res;
312-
});
313312
}
314313

315314
#status;

0 commit comments

Comments
 (0)