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 c16974b091
commit c1871b0f0c
2 changed files with 2 additions and 10 deletions

View File

@@ -2700,11 +2700,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