summaryrefslogtreecommitdiff
path: root/cli/js/os.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2020-01-21 01:30:30 +1100
committerRy Dahl <ry@tinyclouds.org>2020-01-20 09:30:30 -0500
commit60b53fd6b6dc2af83a64c332b9f3a1926f43d631 (patch)
tree4f4ef1aadb8c79ef2319d728b9d5b132af40ef83 /cli/js/os.ts
parent23e67eb5153bd26dbae471b27dc6a21a6d283b0b (diff)
Use globalThis to reference global scope (#3719)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/js/os.ts')
-rw-r--r--cli/js/os.ts19
1 files changed, 9 insertions, 10 deletions
diff --git a/cli/js/os.ts b/cli/js/os.ts
index 9b4301aea..2a3a51de7 100644
--- a/cli/js/os.ts
+++ b/cli/js/os.ts
@@ -5,7 +5,6 @@ import { sendSync } from "./dispatch_json.ts";
import { ErrorKind } from "./errors.ts";
import { assert } from "./util.ts";
import * as util from "./util.ts";
-import { window } from "./window.ts";
import { OperatingSystem, Arch } from "./build.ts";
/** Check if running in terminal.
@@ -109,21 +108,21 @@ export function start(preserveDenoNamespace = true, source?: string): Start {
// pid and noColor need to be set in the Deno module before it's set to be
// frozen.
- util.immutableDefine(window.Deno, "pid", pid);
- util.immutableDefine(window.Deno, "noColor", noColor);
- Object.freeze(window.Deno);
+ util.immutableDefine(globalThis.Deno, "pid", pid);
+ util.immutableDefine(globalThis.Deno, "noColor", noColor);
+ Object.freeze(globalThis.Deno);
if (preserveDenoNamespace) {
- util.immutableDefine(window, "Deno", window.Deno);
+ util.immutableDefine(globalThis, "Deno", globalThis.Deno);
// Deno.core could ONLY be safely frozen here (not in globals.ts)
// since shared_queue.js will modify core properties.
- Object.freeze(window.Deno.core);
+ Object.freeze(globalThis.Deno.core);
// core.sharedQueue is an object so we should also freeze it.
- Object.freeze(window.Deno.core.sharedQueue);
+ Object.freeze(globalThis.Deno.core.sharedQueue);
} else {
- // Remove window.Deno
- delete window.Deno;
- assert(window.Deno === undefined);
+ // Remove globalThis.Deno
+ delete globalThis.Deno;
+ assert(globalThis.Deno === undefined);
}
return startResponse;