Skip to content

Commit 6f58062

Browse files
committed
fix undefined global
1 parent 3cedbb4 commit 6f58062

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const ACORN_PARSE_OPTIONS: AcornOptions = { ecmaVersion: DEFAULT_ECMA_VER
99
export const REQUIRE_PROVIDER_ID = 'requireProvider'
1010
export const CUT = 'cut' // cut operator for Source 4.3
1111
export const TRY_AGAIN = 'retry' // command for Source 4.3
12-
export const GLOBAL = typeof window === 'undefined' ? global : window
12+
export const GLOBAL =
13+
typeof window === 'undefined' ? (typeof global === 'undefined' ? {} : global) : window
1314
export const NATIVE_STORAGE_ID = 'nativeStorage'
1415
export const MAX_LIST_DISPLAY_LENGTH = 100
1516
export const UNKNOWN_LOCATION: es.SourceLocation = {

0 commit comments

Comments
 (0)