Fix tests for new stack clearing in IE

This commit is contained in:
Gregg Van Hove
2016-10-14 15:53:00 -07:00
parent 9750ae59e7
commit 0e9b9a11c3
4 changed files with 22 additions and 15 deletions

View File

@@ -21,13 +21,16 @@ getJasmineRequireObj().clearStack = function(j$) {
if (global && global.process && j$.isFunction_(global.process.nextTick)) {
return global.process.nextTick;
} else if (j$.isFunction_(global.setImmediate)) {
return global.setImmediate;
var realSetImmediate = global.setImmediate;
return function(fn) {
realSetImmediate(fn);
};
} else if (!j$.util.isUndefined(global.MessageChannel)) {
return messageChannelImpl(global);
} else if (j$.isFunction_(global.setTimeout)) {
} else {
var realSetTimeout = global.setTimeout;
return function clearStack(fn) {
realSetTimeout(fn, 0);
Function.prototype.apply.apply(realSetTimeout, [global, [fn, 0]]);
};
}
}