Removed unnecessary throw when building stack trace

Since 4.0, all supported JS runtimes populate the stack property of
Error objects when the Error is instantiated, not when it's thrown.
This commit is contained in:
Steve Gravrock
2023-08-19 09:54:03 -07:00
parent 2a1b7a04f7
commit 26be252e70
2 changed files with 2 additions and 10 deletions

View File

@@ -2645,11 +2645,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
} else if (options.stack) {
error = options;
} else {
try {
throw new Error(message());
} catch (e) {
error = e;
}
error = new Error(message());
}
}
// Omit the message from the stack trace because it will be

View File

@@ -69,11 +69,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
} else if (options.stack) {
error = options;
} else {
try {
throw new Error(message());
} catch (e) {
error = e;
}
error = new Error(message());
}
}
// Omit the message from the stack trace because it will be