Skip to content

Commit

Permalink
fix(global): global variable location no longer assumes module exists
Browse files Browse the repository at this point in the history
closes #24
  • Loading branch information
Rich-Harris authored and benlesh committed Oct 11, 2016
1 parent 87f8f7c commit 4f85ede
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion es/index.js
@@ -1,14 +1,16 @@
/* global window */
import ponyfill from './ponyfill';

var root = module;
var root;

if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global !== 'undefined') {
root = global;
} else if (typeof module !== 'undefined') {
root = module;
} else {
root = Function('return this')();
}
Expand Down

0 comments on commit 4f85ede

Please sign in to comment.