Bug 1285465 - Do not throw when callStack is empty. r=jwalden, a=ritu
authorTooru Fujisawa <arai_a@mac.com>
Thu, 04 Aug 2016 14:52:43 +0900
changeset 349739 fbcb77687057ec9298f8686bc0fe62cc11b59c20
parent 349738 07e7f012e1eee59345eae60b32c96f9e69cf9c09
child 349740 8d65d9b7e5d2dcfeb773a7b6d4c2030d489ae335
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden, ritu
bugs1285465
milestone50.0a2
Bug 1285465 - Do not throw when callStack is empty. r=jwalden, a=ritu
js/src/tests/shell.js
--- a/js/src/tests/shell.js
+++ b/js/src/tests/shell.js
@@ -206,18 +206,18 @@
                              "Test driver failure wrong exit function ");
       }
     }
   }
   global.exitFunc = exitFunc;
 
   /** 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];
   }
   global.currentFunc = currentFunc;
 
   /*****************************************************
    * RHINO-SPECIFIC EXPORTS (are these used any more?) *
    *****************************************************/