]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/arguments-bizarre-behavior.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / arguments-bizarre-behavior.js
CommitLineData
ed1e77d3
A
1function foo(x) {
2 Object.defineProperty(arguments, 0, {configurable: true, enumerable: true, writable:true, value:42});
3 return [x, arguments[0], arguments]
4}
5
6var result = foo(1);
7
8if (result[0] !== 42)
9 throw new Error();
10
11if (result[1] !== 42)
12 throw new Error();
13
14if (Array.prototype.join.call(result[2], ",") != "42")
15 throw new Error();
16
17var array = [];
18for (var s in result[2])
19 array.push(s);
20
21if (array.join(",") != "0")
22 throw new Error();
23
24if (Object.keys(result[2]).join(",") != "0")
25 throw new Error();