diff --git a/library/modules/$.global.js b/library/modules/$.global.js index 8c15fdc5b62d..d2bdc1726c01 100644 --- a/library/modules/$.global.js +++ b/library/modules/$.global.js @@ -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 \ No newline at end of file diff --git a/modules/$.global.js b/modules/$.global.js index 8c15fdc5b62d..d2bdc1726c01 100644 --- a/modules/$.global.js +++ b/modules/$.global.js @@ -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 \ No newline at end of file