summaryrefslogtreecommitdiff
path: root/js/globals.ts
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2019-04-19 17:39:54 -0700
committerRyan Dahl <ry@tinyclouds.org>2019-04-19 20:39:54 -0400
commitc8db224efed08d7722c9951cde048d731db050d3 (patch)
treeb492275744af8dfae9977ef8309925e725daba09 /js/globals.ts
parent0796a8f2f75005df95ef6115a4bdf6dd66e58dc3 (diff)
Make Deno/Deno.core not deletable/writable (#2153)
Diffstat (limited to 'js/globals.ts')
-rw-r--r--js/globals.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/globals.ts b/js/globals.ts
index fae14773b..6ebf3ddfd 100644
--- a/js/globals.ts
+++ b/js/globals.ts
@@ -5,7 +5,7 @@
// library.
// Modules which will make up part of the global public API surface should be
-// imported as namespaces, so when the runtime tpye library is generated they
+// imported as namespaces, so when the runtime type library is generated they
// can be expressed as a namespace in the type library.
import { window } from "./window";
import * as blob from "./blob";
@@ -29,6 +29,7 @@ import * as performanceUtil from "./performance";
// These imports are not exposed and therefore are fine to just import the
// symbols required.
import { core } from "./core";
+import { immutableDefine } from "./util";
// During the build process, augmentations to the variable `window` in this
// file are tracked and created as part of default library that is built into
@@ -44,7 +45,7 @@ window.window = window;
// This is the Deno namespace, it is handled differently from other window
// properties when building the runtime type library, as the whole module
// is flattened into a single namespace.
-window.Deno = deno;
+immutableDefine(window, "Deno", deno);
Object.freeze(window.Deno);
// ref https://console.spec.whatwg.org/#console-namespace