Skip to content

Commit

Permalink
check window before self for global detection, ~IE8 with changed …
Browse files Browse the repository at this point in the history
…`document.domain` case, close #100, #101
  • Loading branch information
zloirock committed Aug 22, 2015
1 parent da94613 commit 2f62d27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions library/modules/$.global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var global = typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
module.exports = global;
var UNDEFINED = 'undefined';
var global = module.exports = typeof window != UNDEFINED && window.Math == Math
? window : typeof self != UNDEFINED && self.Math == Math ? self : Function('return this')();
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
5 changes: 3 additions & 2 deletions modules/$.global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var global = typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
module.exports = global;
var UNDEFINED = 'undefined';
var global = module.exports = typeof window != UNDEFINED && window.Math == Math
? window : typeof self != UNDEFINED && self.Math == Math ? self : Function('return this')();
if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef

0 comments on commit 2f62d27

Please sign in to comment.