]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/sink-arguments-past-invalid-check-dfg.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / sink-arguments-past-invalid-check-dfg.js
diff --git a/tests/stress/sink-arguments-past-invalid-check-dfg.js b/tests/stress/sink-arguments-past-invalid-check-dfg.js
new file mode 100644 (file)
index 0000000..8ee2b25
--- /dev/null
@@ -0,0 +1,17 @@
+var globalResult;
+Object.prototype.valueOf = function() { globalResult = 1; }
+
+function foo() {
+    globalResult = 0;
+    +arguments;
+    return globalResult;
+}
+
+noInline(foo);
+
+for (var i = 0; i < 10000; ++i) {
+    var result = foo();
+    if (result !== 1)
+        throw "Error: bad result: " + result;
+}
+