Merge branch 'issue-1252' of https://github.com/anseki/jasmine into anseki-issue-1252

- Merges #1275 from @anseki
- Fixes #1252
This commit is contained in:
Gregg Van Hove
2017-03-10 14:33:54 -08:00
3 changed files with 53 additions and 2 deletions

View File

@@ -28,7 +28,9 @@ getJasmineRequireObj().toThrowError = function(j$) {
return fail;
}
if (!(thrown instanceof Error)) {
// Get Error constructor of thrown
if (!thrown || !thrown.constructor || !thrown.constructor.constructor ||
!(thrown instanceof (thrown.constructor.constructor('return this')()).Error)) {
fail.message = function() { return 'Expected function to throw an Error, but it threw ' + j$.pp(thrown) + '.'; };
return fail;
}