mirror of
https://github.com/denoland/deno.git
synced 2025-01-10 08:09:06 -05:00
fix: primordials in extensions/net and runtime/js (#11270)
This commit is contained in:
parent
f0fbd49a2d
commit
a8f9ac654d
2 changed files with 9 additions and 7 deletions
|
@ -6,7 +6,6 @@
|
||||||
const { BadResource } = core;
|
const { BadResource } = core;
|
||||||
const {
|
const {
|
||||||
PromiseResolve,
|
PromiseResolve,
|
||||||
Symbol,
|
|
||||||
SymbolAsyncIterator,
|
SymbolAsyncIterator,
|
||||||
Uint8Array,
|
Uint8Array,
|
||||||
TypedArrayPrototypeSubarray,
|
TypedArrayPrototypeSubarray,
|
||||||
|
@ -187,7 +186,7 @@
|
||||||
core.close(this.rid);
|
core.close(this.rid);
|
||||||
}
|
}
|
||||||
|
|
||||||
async *[Symbol.asyncIterator]() {
|
async *[SymbolAsyncIterator]() {
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
yield await this.receive();
|
yield await this.receive();
|
||||||
|
|
|
@ -20,6 +20,7 @@ delete Object.prototype.__proto__;
|
||||||
Symbol,
|
Symbol,
|
||||||
SymbolFor,
|
SymbolFor,
|
||||||
SymbolIterator,
|
SymbolIterator,
|
||||||
|
PromisePrototypeThen,
|
||||||
} = window.__bootstrap.primordials;
|
} = window.__bootstrap.primordials;
|
||||||
const util = window.__bootstrap.util;
|
const util = window.__bootstrap.util;
|
||||||
const eventTarget = window.__bootstrap.eventTarget;
|
const eventTarget = window.__bootstrap.eventTarget;
|
||||||
|
@ -67,11 +68,13 @@ delete Object.prototype.__proto__;
|
||||||
windowIsClosing = true;
|
windowIsClosing = true;
|
||||||
// Push a macrotask to exit after a promise resolve.
|
// Push a macrotask to exit after a promise resolve.
|
||||||
// This is not perfect, but should be fine for first pass.
|
// This is not perfect, but should be fine for first pass.
|
||||||
PromiseResolve().then(() =>
|
PromisePrototypeThen(
|
||||||
FunctionPrototypeCall(timers.setTimeout, null, () => {
|
PromiseResolve(),
|
||||||
// This should be fine, since only Window/MainWorker has .close()
|
() =>
|
||||||
os.exit(0);
|
FunctionPrototypeCall(timers.setTimeout, null, () => {
|
||||||
}, 0)
|
// This should be fine, since only Window/MainWorker has .close()
|
||||||
|
os.exit(0);
|
||||||
|
}, 0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue