From 085897c799dba914e553fcfac83aa3416ab23bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=A4=D1=80=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Mon, 6 Apr 2020 14:01:02 +0300 Subject: [PATCH] feat(internal): Support globalThis in modern environments (#4628) --- src/runtime/internal/globals.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/globals.ts b/src/runtime/internal/globals.ts index 664093d2e4..b97f81ab9f 100644 --- a/src/runtime/internal/globals.ts +++ b/src/runtime/internal/globals.ts @@ -1,3 +1,7 @@ declare const global: any; -export const globals = (typeof window !== 'undefined' ? window : global) as unknown as typeof globalThis; +export const globals = (typeof window !== 'undefined' + ? window + : typeof globalThis !== 'undefined' + ? globalThis + : global) as unknown as typeof globalThis;