@@ -170,7 +170,6 @@ describe("toThrowError", function() {
|
|||||||
result;
|
result;
|
||||||
|
|
||||||
CustomError.prototype = new Error();
|
CustomError.prototype = new Error();
|
||||||
CustomError.prototype.constructor = CustomError;
|
|
||||||
|
|
||||||
result = matcher.compare(fn, CustomError);
|
result = matcher.compare(fn, CustomError);
|
||||||
|
|
||||||
@@ -222,7 +221,6 @@ describe("toThrowError", function() {
|
|||||||
result;
|
result;
|
||||||
|
|
||||||
CustomError.prototype = new Error();
|
CustomError.prototype = new Error();
|
||||||
CustomError.prototype.constructor = CustomError;
|
|
||||||
|
|
||||||
result = matcher.compare(fn, CustomError, "foo");
|
result = matcher.compare(fn, CustomError, "foo");
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ getJasmineRequireObj().toThrowError = function(j$) {
|
|||||||
return expected === null && errorType === null;
|
return expected === null && errorType === null;
|
||||||
},
|
},
|
||||||
matches: function(error) {
|
matches: function(error) {
|
||||||
return (errorType === null || error.constructor === errorType) &&
|
return (errorType === null || error instanceof errorType) &&
|
||||||
(expected === null || messageMatch(error.message));
|
(expected === null || messageMatch(error.message));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user