IE doesn't have console.log.apply(); fall back to console.log() in that case.

This commit is contained in:
Christian Williams 2010-10-05 13:07:41 -07:00
parent 63df354e78
commit 2d10cc1404
2 changed files with 10 additions and 1 deletions

View File

@ -172,6 +172,9 @@ describe("TrivialReporter", function() {
var errorDiv = findElement(divs, 'resultMessage log');
expect(errorDiv.innerHTML).toEqual("this is a multipart log message");
});
xit("should work on IE without console.log.apply", function() {
});
});
describe("duplicate example names", function() {

View File

@ -162,7 +162,13 @@ jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
jasmine.TrivialReporter.prototype.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) console.log.apply(console, arguments);
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};
jasmine.TrivialReporter.prototype.getLocation = function() {