Added test case for nested exits.
authorAndreas Gal <gal@mozilla.com>
Wed, 13 Aug 2008 18:13:22 -0700
changeset 18157 3b13d266b83b735bf3264c009c59bfba9088c7f6
parent 18156 f24fdeae617ba032a0066d95ee4651ec32c7e238
child 18158 57bfefe8dfc3f66251a0b52fa9c719a8c8296cd8
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a2pre
Added test case for nested exits.
js/src/trace-test.js
--- a/js/src/trace-test.js
+++ b/js/src/trace-test.js
@@ -695,11 +695,25 @@ function deepForInLoop() {
   var a = [];
   for (var i in o)
     a[j++] = i;
   return a.join("");
 }
 deepForInLoop.expected = "pqrst";
 test(deepForInLoop);
 
+function nestedExit(x) {
+    var q = 0;
+    for (var i = 0; i < 10; ++i)
+	if (x)
+	    ++q;
+}
+function nestedExitLoop() {
+    for (var j = 0; j < 10; ++j)
+	nestedExit(j < 7);
+    return "ok";
+}
+nestedExitLoop.expected = "ok";
+test(nestedExitLoop);
+
 /* Keep these at the end so that we can see the summary after the trace-debug spew. */
 print("\npassed:", passes.length && passes.join(","));
 print("\nFAILED:", fails.length && fails.join(","));