Fix up my refactoring mistake in toThrowError
strengthen the associated tests to protect against it in the future
This commit is contained in:
@@ -124,14 +124,14 @@ getJasmineRequireObj().toThrowError = function() {
|
||||
}
|
||||
|
||||
function checkForAnErrorType(type) {
|
||||
if (typeof expected == "function") {
|
||||
if (typeof type !== "function") {
|
||||
return false;
|
||||
}
|
||||
|
||||
var Surrogate = function() {};
|
||||
Surrogate.prototype = type.prototype;
|
||||
return (new Surrogate()) instanceof Error;
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user