Add missingArgTest2 to cover the nativeStackOffset bug fixed recently.
authorBrendan Eich <brendan@mozilla.org>
Tue, 12 Aug 2008 23:58:50 -0700
changeset 18125 306f03d5486beece02f1c7414722540163368336
parent 18124 3664167dde3bb9a7005c1ac5563cc41f66a87b6c
child 18126 4300413499aa57e6b9476781e4e3219d009bace6
push id1452
push usershaver@mozilla.com
push dateFri, 22 Aug 2008 00:08:22 +0000
treeherdermozilla-central@d13bb0868596 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.1a2pre
Add missingArgTest2 to cover the nativeStackOffset bug fixed recently.
js/src/trace-test.js
--- a/js/src/trace-test.js
+++ b/js/src/trace-test.js
@@ -653,11 +653,39 @@ function missingArgTest() {
   for (var i = 0; i < 10; i++) {
     q = arity1();
   }
   return q;
 }
 missingArgTest.expected = "1"
 test(missingArgTest);
 
+JSON = function () {
+    return {
+        stringify: function stringify(value, whitelist) {
+            switch (typeof(value)) {
+              case "object":
+                return value.constructor.name;
+            }
+        }
+    };
+}();
+
+function missingArgTest2() {
+  var testPairs = [
+    ["{}", {}],
+    ["[]", []],
+    ['{"foo":"bar"}', {"foo":"bar"}],
+  ]
+  
+  var a = [];
+  for (var i=0; i < testPairs.length; i++) {
+    var s = JSON.stringify(testPairs[i][1])
+    a[i] = s;
+  }
+  return a.join(",");
+}
+missingArgTest2.expected = "Object,Array,Object";
+test(missingArgTest2);
+
 /* 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(","));