Fix up my refactoring mistake in toThrowError

strengthen the associated tests to protect against it in the future
This commit is contained in:
Sheel Choksi
2013-06-04 00:25:12 -07:00
parent b87eb240b3
commit 600be098af
3 changed files with 16 additions and 6 deletions

View File

@@ -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;
};
}
}
};
}