Bug 1285465 - Do not throw when callStack is empty. r=jwalden

This commit is contained in:
Tooru Fujisawa 2016-08-04 14:52:43 +09:00
parent 83a68d4157
commit 6a2df0c986

View File

@ -211,8 +211,8 @@
/** Peeks at the top of the call stack. */
function currentFunc() {
assertEq(callStack.length > 0, true,
"must be a current function to examine");
if (callStack.length == 0)
return "top level script";
return callStack[callStack.length - 1];
}