Removed unnecessary errorWithStack helper

This commit is contained in:
Steve Gravrock
2025-06-22 12:49:26 -07:00
parent 2d07b3e6d7
commit 21db6ec0e3
6 changed files with 155 additions and 229 deletions

View File

@@ -48,16 +48,9 @@ getJasmineRequireObj().util = function(j$) {
return Object.prototype.hasOwnProperty.call(obj, key);
};
util.errorWithStack = function errorWithStack() {
// Don't throw and catch. That makes it harder for users to debug their
// code with exception breakpoints, and it's unnecessary since all
// supported environments populate new Error().stack
return new Error();
};
function callerFile() {
const trace = new j$.StackTrace(util.errorWithStack());
return trace.frames[2].file;
const trace = new j$.StackTrace(new Error());
return trace.frames[1].file;
}
util.jasmineFile = (function() {