diff --git a/lib/jasmine-core/jasmine-html.js b/lib/jasmine-core/jasmine-html.js index 5b090aab..da9ae1b4 100644 --- a/lib/jasmine-core/jasmine-html.js +++ b/lib/jasmine-core/jasmine-html.js @@ -38,7 +38,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, diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index ec432119..903eb97d 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -790,7 +790,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) { @@ -800,15 +800,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) { @@ -962,7 +962,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 || []); } } } diff --git a/spec/html/HtmlReporterSpec.js b/spec/html/HtmlReporterSpec.js index 873cf00f..ffcd7cb8 100644 --- a/spec/html/HtmlReporterSpec.js +++ b/spec/html/HtmlReporterSpec.js @@ -229,7 +229,7 @@ describe("New HtmlReporter", function() { var suiteDetail = outerSuite.childNodes[0]; var suiteLink = suiteDetail.childNodes[0]; - expect(suiteLink.text).toEqual("A Suite"); + expect(suiteLink.innerHTML).toEqual("A Suite"); expect(suiteLink.getAttribute('href')).toEqual("?spec=A%20Suite"); var specs = outerSuite.childNodes[1]; @@ -238,7 +238,7 @@ describe("New HtmlReporter", function() { expect(spec.getAttribute("id")).toEqual("spec-123"); var specLink = spec.childNodes[0]; - expect(specLink.text).toEqual("with a spec"); + expect(specLink.innerHTML).toEqual("with a spec"); expect(specLink.getAttribute("href")).toEqual("?spec=A%20Suite%20with%20a%20spec"); // expect(specLink.getAttribute("title")).toEqual("A Suite with a spec"); }); @@ -481,7 +481,7 @@ describe("New HtmlReporter", function() { expect(menuBar.getAttribute("class")).not.toMatch(/hidden/); var link = menuBar.querySelector('a'); - expect(link.text).toEqual("Failures"); + expect(link.innerHTML).toEqual("Failures"); expect(link.getAttribute("href")).toEqual("#"); }); diff --git a/src/core/Clock.js b/src/core/Clock.js index 8b8eddd6..f8641b51 100644 --- a/src/core/Clock.js +++ b/src/core/Clock.js @@ -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) { diff --git a/src/core/DelayedFunctionScheduler.js b/src/core/DelayedFunctionScheduler.js index 445c4639..3d75dae2 100644 --- a/src/core/DelayedFunctionScheduler.js +++ b/src/core/DelayedFunctionScheduler.js @@ -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 || []); } } } diff --git a/src/html/HtmlReporter.js b/src/html/HtmlReporter.js index 57bb428f..71c32ee9 100644 --- a/src/html/HtmlReporter.js +++ b/src/html/HtmlReporter.js @@ -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,