Add a few bits to frame.arguments tests.
authorJason Orendorff <jorendorff@mozilla.com>
Thu, 26 May 2011 12:13:45 -0500
changeset 74457 614e714d02981477663bdfd58f30bf5aa34a936b
parent 74456 d249478fbbe1828131c1d7388dfb361378e501fe
child 74458 f95a35c5010cb770791369c2a61714441f66e72a
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone6.0a1
Add a few bits to frame.arguments tests.
js/src/jit-test/tests/debug/Frame-arguments-01.js
js/src/jit-test/tests/debug/Frame-arguments-05.js
--- a/js/src/jit-test/tests/debug/Frame-arguments-01.js
+++ b/js/src/jit-test/tests/debug/Frame-arguments-01.js
@@ -5,16 +5,18 @@ var g = newGlobal('new-compartment');
 g.args = null;
 var dbg = new Debug(g);
 var hits;
 var v;
 dbg.hooks = {
     debuggerHandler: function (frame) {
         hits++;
         var args = frame.arguments;
+        assertEq(args instanceof Array, true);
+        assertEq(Array.isArray(args), false);
         assertEq(args, frame.arguments);
         assertEq(args.length, g.args.length);
         for (var i = 0; i < args.length; i++)
             assertEq(args[i], g.args[i]);
     }
 };
 
 // no formal parameters
--- a/js/src/jit-test/tests/debug/Frame-arguments-05.js
+++ b/js/src/jit-test/tests/debug/Frame-arguments-05.js
@@ -1,15 +1,22 @@
 // |jit-test| debug
 // frame.arguments is "live" (it reflects assignments to arguments).
 
 var g = newGlobal('new-compartment');
 var dbg = new Debug(g);
 var log = '';
+var args;
 dbg.hooks = {
     debuggerHandler: function (frame) {
-        log += frame.arguments[0];
+        if (args === undefined)
+            args = frame.arguments;
+        else
+            assertEq(frame.arguments, args);
+        log += args[0];
+        assertEq(frame.eval("x = '0';").return, '0');
+        log += args[0];
     }
 };
 
 g.eval("function f(x) { x = '2'; debugger; x = '3'; debugger; }");
 g.f("1");
-assertEq(log, "23");
+assertEq(log, "2030");