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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user