diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 7e553186..1bef5eb9 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -24,7 +24,11 @@ var getJasmineRequireObj = (function (jasmineGlobal) { var jasmineRequire; if (typeof module !== 'undefined' && module.exports) { - jasmineGlobal = global; + if (typeof global !== 'undefined') { + jasmineGlobal = global; + } else { + jasmineGlobal = {}; + } jasmineRequire = exports; } else { if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') { diff --git a/src/core/requireCore.js b/src/core/requireCore.js index aaefbed3..9f2490d5 100644 --- a/src/core/requireCore.js +++ b/src/core/requireCore.js @@ -2,7 +2,11 @@ var getJasmineRequireObj = (function (jasmineGlobal) { var jasmineRequire; if (typeof module !== 'undefined' && module.exports) { - jasmineGlobal = global; + if (typeof global !== 'undefined') { + jasmineGlobal = global; + } else { + jasmineGlobal = {}; + } jasmineRequire = exports; } else { if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') {