diff options
Diffstat (limited to 'std/node/global.ts')
-rw-r--r-- | std/node/global.ts | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/std/node/global.ts b/std/node/global.ts index b102edddc..0ef688e63 100644 --- a/std/node/global.ts +++ b/std/node/global.ts @@ -1,35 +1,24 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import process from "./process.ts"; -import { Buffer as buffer } from "./buffer.ts"; +/// <reference path="./global.d.ts" /> +import { process as processModule } from "./process.ts"; +import { Buffer as bufferModule } from "./_buffer.ts"; -Object.defineProperty(globalThis, Symbol.toStringTag, { - value: "global", +Object.defineProperty(globalThis, "global", { + value: globalThis, writable: false, enumerable: false, configurable: true, }); -// deno-lint-ignore no-explicit-any -(globalThis as any)["global"] = globalThis; - -// Define the type for the global declration -type Process = typeof process; -type Buffer = typeof buffer; - Object.defineProperty(globalThis, "process", { - value: process, + value: processModule, enumerable: false, writable: true, configurable: true, }); -declare global { - const process: Process; - const Buffer: Buffer; -} - Object.defineProperty(globalThis, "Buffer", { - value: buffer, + value: bufferModule, enumerable: false, writable: true, configurable: true, |