2020-09-21 21:26:41 +09:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2020-11-07 11:27:07 -08:00
|
|
|
import process from "./process.ts";
|
|
|
|
import { Buffer as buffer } from "./buffer.ts";
|
2020-09-21 21:26:41 +09:00
|
|
|
|
2020-04-30 20:58:40 +03:00
|
|
|
Object.defineProperty(globalThis, Symbol.toStringTag, {
|
|
|
|
value: "global",
|
|
|
|
writable: false,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
2020-11-03 16:19:29 +01:00
|
|
|
// deno-lint-ignore no-explicit-any
|
2020-06-02 14:24:44 +10:00
|
|
|
(globalThis as any)["global"] = globalThis;
|
2020-08-12 11:01:36 +01:00
|
|
|
|
2020-11-07 11:27:07 -08:00
|
|
|
// Define the type for the global declration
|
|
|
|
type Process = typeof process;
|
|
|
|
type Buffer = typeof buffer;
|
|
|
|
|
|
|
|
Object.defineProperty(globalThis, "process", {
|
|
|
|
value: process,
|
|
|
|
enumerable: false,
|
|
|
|
writable: true,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
const process: Process;
|
|
|
|
const Buffer: Buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.defineProperty(globalThis, "Buffer", {
|
|
|
|
value: buffer,
|
|
|
|
enumerable: false,
|
|
|
|
writable: true,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
2020-08-12 11:01:36 +01:00
|
|
|
export {};
|