Skip to content

Commit

Permalink
Use window as global by default, fall back to eval
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzuehling authored and solkimicreb committed Feb 12, 2019
1 parent 734bd8e commit abd2fc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/builtIns/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import collectionHandlers from './collections'

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

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

0 comments on commit abd2fc3

Please sign in to comment.