diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index ab8a3dae..d4bdcd70 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -1364,7 +1364,7 @@ jasmine.Matchers.prototype.toThrow = function(expected) { var not = this.isNot ? "not " : ""; this.message = function() { - if (exception && (jasmine.util.isUndefined(expected) || !this.env.equals_(exception.message || exception, expected.message || expected))) { + if (exception) { return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); } else { return "Expected function to throw an exception."; diff --git a/src/core/Matchers.js b/src/core/Matchers.js index 15c4515e..631e555d 100644 --- a/src/core/Matchers.js +++ b/src/core/Matchers.js @@ -239,7 +239,7 @@ jasmine.Matchers.prototype.toThrow = function(expected) { var not = this.isNot ? "not " : ""; this.message = function() { - if (exception && (jasmine.util.isUndefined(expected) || !this.env.equals_(exception.message || exception, expected.message || expected))) { + if (exception) { return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); } else { return "Expected function to throw an exception.";