check for global before assigning

This commit is contained in:
soycode
2015-08-17 14:06:28 -07:00
parent 6028a5d92c
commit 850bee5492
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -24,7 +24,11 @@ var getJasmineRequireObj = (function (jasmineGlobal) {
var jasmineRequire; var jasmineRequire;
if (typeof module !== 'undefined' && module.exports) { if (typeof module !== 'undefined' && module.exports) {
jasmineGlobal = global; if (typeof global !== 'undefined') {
jasmineGlobal = global;
} else {
jasmineGlobal = {};
}
jasmineRequire = exports; jasmineRequire = exports;
} else { } else {
if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') { if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') {
+5 -1
View File
@@ -2,7 +2,11 @@ var getJasmineRequireObj = (function (jasmineGlobal) {
var jasmineRequire; var jasmineRequire;
if (typeof module !== 'undefined' && module.exports) { if (typeof module !== 'undefined' && module.exports) {
jasmineGlobal = global; if (typeof global !== 'undefined') {
jasmineGlobal = global;
} else {
jasmineGlobal = {};
}
jasmineRequire = exports; jasmineRequire = exports;
} else { } else {
if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') { if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') {