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:
@@ -2700,11 +2700,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
|
|||||||
} else if (options.stack) {
|
} else if (options.stack) {
|
||||||
error = options;
|
error = options;
|
||||||
} else {
|
} else {
|
||||||
try {
|
error = new Error(message());
|
||||||
throw new Error(message());
|
|
||||||
} catch (e) {
|
|
||||||
error = e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Omit the message from the stack trace because it will be
|
// Omit the message from the stack trace because it will be
|
||||||
|
|||||||
@@ -69,11 +69,7 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
|
|||||||
} else if (options.stack) {
|
} else if (options.stack) {
|
||||||
error = options;
|
error = options;
|
||||||
} else {
|
} else {
|
||||||
try {
|
error = new Error(message());
|
||||||
throw new Error(message());
|
|
||||||
} catch (e) {
|
|
||||||
error = e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Omit the message from the stack trace because it will be
|
// Omit the message from the stack trace because it will be
|
||||||
|
|||||||
Reference in New Issue
Block a user