]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/fold-to-primitive-to-identity-in-cfa.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / fold-to-primitive-to-identity-in-cfa.js
1 function foo(x, p) {
2 if (DFGTrue())
3 x = p ? "hello" : "bar";
4 return x + " world";
5 }
6
7 noInline(foo);
8
9 for (var i = 0; i < 100000; ++i) {
10 var result = foo({toString:function() { return "foo" }}, i & 1);
11 if (result != "foo world" && result != "hello world" && result != "bar world")
12 throw "Error: bad result: " + result;
13 }
14