diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2022-10-29 18:25:23 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-29 18:25:23 +0900 |
commit | 59ac110edd1f376bed7fa6bbdbe2ee09c266bf74 (patch) | |
tree | da654d1ecb6141b620141d634d99ca34c6d568db /runtime/js | |
parent | edaceecec771cf0395639175b5a21d20530f6080 (diff) |
fix(core): fix APIs not to be affected by `Promise.prototype.then` modification (#16326)
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/40_spawn.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/js/40_spawn.js b/runtime/js/40_spawn.js index a9a968ba3..a927d619e 100644 --- a/runtime/js/40_spawn.js +++ b/runtime/js/40_spawn.js @@ -13,7 +13,8 @@ String, TypeError, Uint8Array, - PromiseAll, + PromisePrototypeThen, + SafePromiseAll, SymbolFor, } = window.__bootstrap.primordials; const { @@ -155,7 +156,7 @@ const waitPromise = core.opAsync("op_spawn_wait", this.#rid); this.#waitPromiseId = waitPromise[promiseIdSymbol]; - this.#status = waitPromise.then((res) => { + this.#status = PromisePrototypeThen(waitPromise, (res) => { this.#rid = null; signal?.[remove](onAbort); return res; @@ -179,7 +180,7 @@ ); } - const [status, stdout, stderr] = await PromiseAll([ + const [status, stdout, stderr] = await SafePromiseAll([ this.#status, collectOutput(this.#stdout), collectOutput(this.#stderr), |