Detect global object properly when getting the jasmine require obj
- Pull global detection into requireCore and pass the global to base Fix #569 [fix #73684570]
This commit is contained in:
@@ -20,19 +20,24 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
function getJasmineRequireObj() {
|
getJasmineRequireObj = (function (jasmineGlobal) {
|
||||||
|
var jasmineRequire;
|
||||||
|
|
||||||
if (typeof module !== 'undefined' && module.exports) {
|
if (typeof module !== 'undefined' && module.exports) {
|
||||||
return exports;
|
jasmineGlobal = global;
|
||||||
|
jasmineRequire = exports;
|
||||||
} else {
|
} else {
|
||||||
window.jasmineRequire = window.jasmineRequire || {};
|
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
|
||||||
return window.jasmineRequire;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getJasmineRequireObj().core = function(jRequire) {
|
function getJasmineRequire() {
|
||||||
|
return jasmineRequire;
|
||||||
|
}
|
||||||
|
|
||||||
|
getJasmineRequire().core = function(jRequire) {
|
||||||
var j$ = {};
|
var j$ = {};
|
||||||
|
|
||||||
jRequire.base(j$);
|
jRequire.base(j$, jasmineGlobal);
|
||||||
j$.util = jRequire.util();
|
j$.util = jRequire.util();
|
||||||
j$.Any = jRequire.Any();
|
j$.Any = jRequire.Any();
|
||||||
j$.CallTracker = jRequire.CallTracker();
|
j$.CallTracker = jRequire.CallTracker();
|
||||||
@@ -60,6 +65,9 @@ getJasmineRequireObj().core = function(jRequire) {
|
|||||||
return j$;
|
return j$;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return getJasmineRequire;
|
||||||
|
})(this);
|
||||||
|
|
||||||
getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
||||||
var availableMatchers = [
|
var availableMatchers = [
|
||||||
'toBe',
|
'toBe',
|
||||||
@@ -90,12 +98,7 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
|||||||
return matchers;
|
return matchers;
|
||||||
};
|
};
|
||||||
|
|
||||||
getJasmineRequireObj().base = (function (jasmineGlobal) {
|
getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||||
if (typeof module !== 'undefined' && module.exports) {
|
|
||||||
jasmineGlobal = global;
|
|
||||||
}
|
|
||||||
|
|
||||||
return function(j$) {
|
|
||||||
j$.unimplementedMethod_ = function() {
|
j$.unimplementedMethod_ = function() {
|
||||||
throw new Error('unimplemented method');
|
throw new Error('unimplemented method');
|
||||||
};
|
};
|
||||||
@@ -191,7 +194,6 @@ getJasmineRequireObj().base = (function (jasmineGlobal) {
|
|||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})(this);
|
|
||||||
|
|
||||||
getJasmineRequireObj().util = function() {
|
getJasmineRequireObj().util = function() {
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
getJasmineRequireObj().base = (function (jasmineGlobal) {
|
getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||||
if (typeof module !== 'undefined' && module.exports) {
|
|
||||||
jasmineGlobal = global;
|
|
||||||
}
|
|
||||||
|
|
||||||
return function(j$) {
|
|
||||||
j$.unimplementedMethod_ = function() {
|
j$.unimplementedMethod_ = function() {
|
||||||
throw new Error('unimplemented method');
|
throw new Error('unimplemented method');
|
||||||
};
|
};
|
||||||
@@ -99,4 +94,3 @@ getJasmineRequireObj().base = (function (jasmineGlobal) {
|
|||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})(this);
|
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
function getJasmineRequireObj() {
|
getJasmineRequireObj = (function (jasmineGlobal) {
|
||||||
|
var jasmineRequire;
|
||||||
|
|
||||||
if (typeof module !== 'undefined' && module.exports) {
|
if (typeof module !== 'undefined' && module.exports) {
|
||||||
return exports;
|
jasmineGlobal = global;
|
||||||
|
jasmineRequire = exports;
|
||||||
} else {
|
} else {
|
||||||
window.jasmineRequire = window.jasmineRequire || {};
|
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
|
||||||
return window.jasmineRequire;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getJasmineRequireObj().core = function(jRequire) {
|
function getJasmineRequire() {
|
||||||
|
return jasmineRequire;
|
||||||
|
}
|
||||||
|
|
||||||
|
getJasmineRequire().core = function(jRequire) {
|
||||||
var j$ = {};
|
var j$ = {};
|
||||||
|
|
||||||
jRequire.base(j$);
|
jRequire.base(j$, jasmineGlobal);
|
||||||
j$.util = jRequire.util();
|
j$.util = jRequire.util();
|
||||||
j$.Any = jRequire.Any();
|
j$.Any = jRequire.Any();
|
||||||
j$.CallTracker = jRequire.CallTracker();
|
j$.CallTracker = jRequire.CallTracker();
|
||||||
@@ -37,3 +42,6 @@ getJasmineRequireObj().core = function(jRequire) {
|
|||||||
|
|
||||||
return j$;
|
return j$;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return getJasmineRequire;
|
||||||
|
})(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user