From fce1136b14244e0eb6593d4eafe254ff82d06133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2=20=D0=98=D0=B3=D0=BE?= =?UTF-8?q?=D1=80=D1=8C?= Date: Sat, 4 Apr 2020 12:55:49 +0300 Subject: [PATCH] feat(internal): Support globalThis in modern environments fix #3561 --- 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..831555163f 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 globalThis !== 'undefined' + ? globalThis + : typeof window !== 'undefined' + ? window + : global) as unknown as typeof globalThis;