]> git.saurik.com Git - apple/javascriptcore.git/blame_incremental - tests/stress/arguments-bizarre-behaviour-disable-enumerability.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / arguments-bizarre-behaviour-disable-enumerability.js
... / ...
CommitLineData
1function foo(x) {
2 Object.defineProperty(arguments, 0, {configurable: true, enumerable: false, 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();
26
27// FIXME: This is totally weird!
28// https://bugs.webkit.org/show_bug.cgi?id=141952
29if (Object.getOwnPropertyDescriptor(result[2], 0).enumerable !== true)
30 throw new Error();