Set jasmineGlobal correctly in GJS
In GJS, jasmineGlobal was not getting set to the global object; when importing jasmine.js in GJS, "this" resolves to the jasmine.js module object, not the global object. Solve this specifically for GJS by assuming that `window.toString === '[object GjsGlobal]'` only in GJS; if this is the case, assign "window" to "jasmineGlobal". Adding a "var" to the declaration of "getJasmineRequireObj" is also necessary, or else "getJasmineRequireObj" won't be exported in the Jasmine module. See #751
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
getJasmineRequireObj = (function (jasmineGlobal) {
|
var getJasmineRequireObj = (function (jasmineGlobal) {
|
||||||
var jasmineRequire;
|
var jasmineRequire;
|
||||||
|
|
||||||
if (typeof module !== 'undefined' && module.exports) {
|
if (typeof module !== 'undefined' && module.exports) {
|
||||||
jasmineGlobal = global;
|
jasmineGlobal = global;
|
||||||
jasmineRequire = exports;
|
jasmineRequire = exports;
|
||||||
} else {
|
} else {
|
||||||
|
if (typeof window !== 'undefined' && typeof window.toString === 'function' && window.toString() === '[object GjsGlobal]') {
|
||||||
|
jasmineGlobal = window;
|
||||||
|
}
|
||||||
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
|
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user