]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/get-stack-mapping-with-dead-get-stack.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / get-stack-mapping-with-dead-get-stack.js
diff --git a/tests/stress/get-stack-mapping-with-dead-get-stack.js b/tests/stress/get-stack-mapping-with-dead-get-stack.js
new file mode 100644 (file)
index 0000000..e158ccb
--- /dev/null
@@ -0,0 +1,27 @@
+function bar() {
+    if (foo.arguments[0] === void 0)
+        throw "Error: foo.arguments[0] should not be undefined but is."
+}
+
+noInline(bar);
+
+function foo(a, p) {
+    var tmp = a;
+    effectful42();
+    for (var i = 0; i < 10; ++i) {
+        bar();
+        a = i;
+    }
+    if (p) {
+        var tmp = arguments;
+    }
+    return a;
+}
+
+noInline(foo);
+
+for (var i = 0; i < 10000; ++i) {
+    var result = foo(0, false);
+    if (result != 9)
+        throw "Error: bad result: " + result;
+}