Older IE fixes

Still not green, but getting close. Summary of Older IE discrepancies:
- Older IE doesn't have apply/call on the timing functions
- Older IE doesn't allow applying falsy arguments
- Older IE doesn't allow setting onclick to undefined values
- Older IE doesn't have text property on dom nodes
This commit is contained in:
Sheel Choksi
2013-07-21 18:40:12 -07:00
parent d4f78922cd
commit 61a1f93488
6 changed files with 15 additions and 15 deletions

View File

@@ -34,7 +34,7 @@ getJasmineRequireObj().Clock = function() {
}
return timer.setTimeout(fn, delay);
}
return timer.setTimeout.apply(global, arguments);
return Function.prototype.apply.apply(timer.setTimeout, [global, arguments]);
};
self.setInterval = function(fn, delay, params) {
@@ -44,15 +44,15 @@ getJasmineRequireObj().Clock = function() {
}
return timer.setInterval(fn, delay);
}
return timer.setInterval.apply(global, arguments);
return Function.prototype.apply.apply(timer.setInterval, [global, arguments]);
};
self.clearTimeout = function(id) {
return timer.clearTimeout.call(global, id);
return Function.prototype.call.apply(timer.clearTimeout, [global, id]);
};
self.clearInterval = function(id) {
return timer.clearInterval.call(global, id);
return Function.prototype.call.apply(timer.clearInterval, [global, id]);
};
self.tick = function(millis) {

View File

@@ -108,7 +108,7 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
for (var i = 0; i < funcsToRun.length; ++i) {
var funcToRun = funcsToRun[i];
funcToRun.funcToCall.apply(null, funcToRun.params);
funcToRun.funcToCall.apply(null, funcToRun.params || []);
}
}
}

View File

@@ -10,7 +10,7 @@ jasmineRequire.HtmlReporter = function(j$) {
getContainer = options.getContainer,
createElement = options.createElement,
createTextNode = options.createTextNode,
onRaiseExceptionsClick = options.onRaiseExceptionsClick,
onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {},
timer = options.timer || noopTimer,
results = [],
specsExecuted = 0,