diff --git a/spec/core/MatchersSpec.js b/spec/core/MatchersSpec.js index 73cfe1f7..97c3f60d 100644 --- a/spec/core/MatchersSpec.js +++ b/spec/core/MatchersSpec.js @@ -82,7 +82,7 @@ describe("jasmine.Matchers", function() { expect((match(/[abc]/gm).toNotEqual(/1/i))).toPass(); // only test if the browser supports the sticky option on a regExp see pull #234 - if (RegExp.prototype.sticky !== undefined) { + if (typeof RegExp.prototype.sticky !== 'undefined') { var sticky_regexp = new RegExp("[abc]", "y"); expect((match(sticky_regexp).toEqual(/1/i))).toFail(); expect((match(sticky_regexp).toNotEqual(/1/i))).toPass(); diff --git a/src/console/ConsoleReporter.js b/src/console/ConsoleReporter.js index e65be81b..40d9e025 100644 --- a/src/console/ConsoleReporter.js +++ b/src/console/ConsoleReporter.js @@ -141,9 +141,10 @@ jasmine.ConsoleReporter = function(print, doneCallback, showColors) { failedSpecResults: [] }; - suite.results().items_.forEach(function(spec) { + for(var i = 0; i < suite.results().items_.length; i++) { + var spec = suite.results().items_[i]; if (spec.failedCount > 0 && spec.description) suiteResult.failedSpecResults.push(spec); - }); + } this.suiteResults.push(suiteResult); }; @@ -174,4 +175,4 @@ jasmine.ConsoleReporter = function(print, doneCallback, showColors) { summaryFunction(runner.specs().length, results.failedCount); doneCallback(runner); }; -}; \ No newline at end of file +};