]> git.saurik.com Git - apple/javascriptcore.git/blame_incremental - tests/stress/call-varargs-length-effects.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / call-varargs-length-effects.js
... / ...
CommitLineData
1function foo() { return arguments.length; }
2
3var o = {};
4o[0] = 42;
5var callCount = 0;
6o.__defineGetter__("length", function() {
7 callCount++;
8 return 1;
9});
10
11function bar() {
12 callCount = 0;
13 var result = foo.apply(this, o);
14 if (result != 1)
15 throw "Error: bad result: " + result;
16 if (callCount != 1)
17 throw "Error: bad call count: " + callCount;
18}
19
20noInline(foo);
21noInline(bar);
22
23for (var i = 0; i < 10000; ++i)
24 bar();