]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/sink-arguments-past-invalid-check.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / sink-arguments-past-invalid-check.js
CommitLineData
ed1e77d3
A
1var globalResult;
2Object.prototype.valueOf = function() { globalResult = 1; }
3
4function foo(p) {
5 globalResult = 0;
6 var o = arguments;
7 if (p)
8 +o;
9 return globalResult;
10}
11
12noInline(foo);
13
14for (var i = 0; i < 10000; ++i) {
15 var result = foo(false);
16 if (result !== 0)
17 throw "Error: bad result: " + result;
18}
19
20var result = foo(true);
21if (result !== 1)
22 throw "Error: bad result at end: " + result;
23