mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
fix(core): fix APIs not to be affected by Promise.prototype.then
modification (#16326)
This commit is contained in:
parent
edaceecec7
commit
59ac110edd
8 changed files with 145 additions and 42 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue