Skip to content

Commit abd2fc3

Browse files
moritzuehlingsolkimicreb
authored andcommitted
Use window as global by default, fall back to eval
1 parent 734bd8e commit abd2fc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/builtIns/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import collectionHandlers from './collections'
22

33
// eslint-disable-next-line
4-
const globalObj = Function("return this")();
4+
const globalObj = typeof window === 'object' ? window : Function('return this')();
55

66
// built-in object can not be wrapped by Proxies
77
// their methods expect the object instance as the 'this' instead of the Proxy wrapper

0 commit comments

Comments
 (0)