Provide option to delete Deno namespace in worker (#2717)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2019-08-05 04:23:41 -07:00 committed by Ryan Dahl
parent aaa7a3eac4
commit ddee2dff14
18 changed files with 128 additions and 17 deletions

View file

@ -32,7 +32,6 @@ import * as request from "./request";
// 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
@ -71,7 +70,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.
immutableDefine(window, "Deno", deno);
window.Deno = deno;
Object.freeze(window.Deno);
// Globally available functions and object instances.