1
0
Fork 0
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:
Simon Rask 2021-07-04 17:26:38 +02:00 committed by GitHub
parent f0fbd49a2d
commit a8f9ac654d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -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();

View file

@ -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),
);
}
}