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
|
||||
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) {
|
||||
return exports;
|
||||
jasmineGlobal = global;
|
||||
jasmineRequire = exports;
|
||||
} else {
|
||||
window.jasmineRequire = window.jasmineRequire || {};
|
||||
return window.jasmineRequire;
|
||||
}
|
||||
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
|
||||
}
|
||||
|
||||
getJasmineRequireObj().core = function(jRequire) {
|
||||
function getJasmineRequire() {
|
||||
return jasmineRequire;
|
||||
}
|
||||
|
||||
getJasmineRequire().core = function(jRequire) {
|
||||
var j$ = {};
|
||||
|
||||
jRequire.base(j$);
|
||||
jRequire.base(j$, jasmineGlobal);
|
||||
j$.util = jRequire.util();
|
||||
j$.Any = jRequire.Any();
|
||||
j$.CallTracker = jRequire.CallTracker();
|
||||
@@ -60,6 +65,9 @@ getJasmineRequireObj().core = function(jRequire) {
|
||||
return j$;
|
||||
};
|
||||
|
||||
return getJasmineRequire;
|
||||
})(this);
|
||||
|
||||
getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
||||
var availableMatchers = [
|
||||
'toBe',
|
||||
@@ -90,12 +98,7 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
|
||||
return matchers;
|
||||
};
|
||||
|
||||
getJasmineRequireObj().base = (function (jasmineGlobal) {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
jasmineGlobal = global;
|
||||
}
|
||||
|
||||
return function(j$) {
|
||||
getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
j$.unimplementedMethod_ = function() {
|
||||
throw new Error('unimplemented method');
|
||||
};
|
||||
@@ -191,7 +194,6 @@ getJasmineRequireObj().base = (function (jasmineGlobal) {
|
||||
return obj;
|
||||
};
|
||||
};
|
||||
})(this);
|
||||
|
||||
getJasmineRequireObj().util = function() {
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
getJasmineRequireObj().base = (function (jasmineGlobal) {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
jasmineGlobal = global;
|
||||
}
|
||||
|
||||
return function(j$) {
|
||||
getJasmineRequireObj().base = function(j$, jasmineGlobal) {
|
||||
j$.unimplementedMethod_ = function() {
|
||||
throw new Error('unimplemented method');
|
||||
};
|
||||
@@ -99,4 +94,3 @@ getJasmineRequireObj().base = (function (jasmineGlobal) {
|
||||
return obj;
|
||||
};
|
||||
};
|
||||
})(this);
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
function getJasmineRequireObj() {
|
||||
getJasmineRequireObj = (function (jasmineGlobal) {
|
||||
var jasmineRequire;
|
||||
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
return exports;
|
||||
jasmineGlobal = global;
|
||||
jasmineRequire = exports;
|
||||
} else {
|
||||
window.jasmineRequire = window.jasmineRequire || {};
|
||||
return window.jasmineRequire;
|
||||
}
|
||||
jasmineRequire = jasmineGlobal.jasmineRequire = jasmineGlobal.jasmineRequire || {};
|
||||
}
|
||||
|
||||
getJasmineRequireObj().core = function(jRequire) {
|
||||
function getJasmineRequire() {
|
||||
return jasmineRequire;
|
||||
}
|
||||
|
||||
getJasmineRequire().core = function(jRequire) {
|
||||
var j$ = {};
|
||||
|
||||
jRequire.base(j$);
|
||||
jRequire.base(j$, jasmineGlobal);
|
||||
j$.util = jRequire.util();
|
||||
j$.Any = jRequire.Any();
|
||||
j$.CallTracker = jRequire.CallTracker();
|
||||
@@ -37,3 +42,6 @@ getJasmineRequireObj().core = function(jRequire) {
|
||||
|
||||
return j$;
|
||||
};
|
||||
|
||||
return getJasmineRequire;
|
||||
})(this);
|
||||
|
||||
Reference in New Issue
Block a user