Explicitly pass in timing functions in mock clock integration specs

- This way we can make sure that clear stack always works no matter
  how long the suite in the spec is

[fixes #153518103]
This commit is contained in:
Gregg Van Hove
2018-04-23 17:25:11 -07:00
parent c440d13754
commit 7e14a97371
3 changed files with 30 additions and 21 deletions

View File

@@ -112,7 +112,7 @@ getJasmineRequireObj().util = function(j$) {
return false;
}
function errorWithStack() {
util.errorWithStack = function errorWithStack () {
// Don't throw and catch if we don't have to, because it makes it harder
// for users to debug their code with exception breakpoints.
var error = new Error();
@@ -127,10 +127,10 @@ getJasmineRequireObj().util = function(j$) {
} catch (e) {
return e;
}
}
};
function callerFile() {
var trace = new j$.StackTrace(errorWithStack());
var trace = new j$.StackTrace(util.errorWithStack());
return trace.frames[2].file;
}