0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 20:25:12 -05:00

fix(std/node): replace uses of window with globalThis (#9237)

This commit is contained in:
Liam Murphy 2021-01-24 12:17:06 +11:00 committed by GitHub
parent a61389a55e
commit 25830a1067
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -1021,7 +1021,7 @@ const CircularRequirePrototypeWarningProxy = new Proxy(
// Object.prototype and ObjectProtoype refer to our 'primordials' versions
// and are not identical to the versions on the global object.
const PublicObjectPrototype = window.Object.prototype;
const PublicObjectPrototype = globalThis.Object.prototype;
// deno-lint-ignore no-explicit-any
function getExportsForCircularRequire(module: Module): any {

View file

@ -1,17 +1,17 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
// TODO(bartlomieju): implement the 'NodeJS.Timeout' and 'NodeJS.Immediate' versions of the timers.
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1163ead296d84e7a3c80d71e7c81ecbd1a130e9a/types/node/v12/globals.d.ts#L1120-L1131
export const setTimeout = window.setTimeout;
export const clearTimeout = window.clearTimeout;
export const setInterval = window.setInterval;
export const clearInterval = window.clearInterval;
export const setTimeout = globalThis.setTimeout;
export const clearTimeout = globalThis.clearTimeout;
export const setInterval = globalThis.setInterval;
export const clearInterval = globalThis.clearInterval;
export const setImmediate = (
// deno-lint-ignore no-explicit-any
cb: (...args: any[]) => void,
// deno-lint-ignore no-explicit-any
...args: any[]
): number => window.setTimeout(cb, 0, ...args);
export const clearImmediate = window.clearTimeout;
): number => globalThis.setTimeout(cb, 0, ...args);
export const clearImmediate = globalThis.clearTimeout;
export default {
setTimeout,