From 898773d3f89b12e84d371644d4f13dec078bdc13 Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Thu, 30 Apr 2020 20:58:40 +0300 Subject: [PATCH] std/node: toString for globals (#5013) --- std/node/global.ts | 7 +++++++ std/node/process.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/std/node/global.ts b/std/node/global.ts index c889e9c8df..c877d1d531 100644 --- a/std/node/global.ts +++ b/std/node/global.ts @@ -1,2 +1,9 @@ +Object.defineProperty(globalThis, Symbol.toStringTag, { + value: "global", + writable: false, + enumerable: false, + configurable: true, +}); + // @ts-ignore globalThis["global"] = globalThis; diff --git a/std/node/process.ts b/std/node/process.ts index f4bdd8686d..9da41b45b2 100644 --- a/std/node/process.ts +++ b/std/node/process.ts @@ -38,6 +38,13 @@ export const process = { }, }; +Object.defineProperty(process, Symbol.toStringTag, { + enumerable: false, + writable: true, + configurable: false, + value: "process", +}); + Object.defineProperty(globalThis, "process", { value: process, enumerable: false,