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 {
|
||||
PromiseResolve,
|
||||
Symbol,
|
||||
SymbolAsyncIterator,
|
||||
Uint8Array,
|
||||
TypedArrayPrototypeSubarray,
|
||||
|
@ -187,7 +186,7 @@
|
|||
core.close(this.rid);
|
||||
}
|
||||
|
||||
async *[Symbol.asyncIterator]() {
|
||||
async *[SymbolAsyncIterator]() {
|
||||
while (true) {
|
||||
try {
|
||||
yield await this.receive();
|
||||
|
|
|
@ -20,6 +20,7 @@ delete Object.prototype.__proto__;
|
|||
Symbol,
|
||||
SymbolFor,
|
||||
SymbolIterator,
|
||||
PromisePrototypeThen,
|
||||
} = window.__bootstrap.primordials;
|
||||
const util = window.__bootstrap.util;
|
||||
const eventTarget = window.__bootstrap.eventTarget;
|
||||
|
@ -67,11 +68,13 @@ delete Object.prototype.__proto__;
|
|||
windowIsClosing = true;
|
||||
// Push a macrotask to exit after a promise resolve.
|
||||
// This is not perfect, but should be fine for first pass.
|
||||
PromiseResolve().then(() =>
|
||||
FunctionPrototypeCall(timers.setTimeout, null, () => {
|
||||
// This should be fine, since only Window/MainWorker has .close()
|
||||
os.exit(0);
|
||||
}, 0)
|
||||
PromisePrototypeThen(
|
||||
PromiseResolve(),
|
||||
() =>
|
||||
FunctionPrototypeCall(timers.setTimeout, null, () => {
|
||||
// This should be fine, since only Window/MainWorker has .close()
|
||||
os.exit(0);
|
||||
}, 0),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue