]> git.saurik.com Git - apple/javascriptcore.git/blob - 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
1 function foo(x) {
2 Object.defineProperty(arguments, 0, {configurable: true, enumerable: false, writable:true, value:42});
3 return [x, arguments[0], arguments]
4 }
5
6 var result = foo(1);
7
8 if (result[0] !== 42)
9 throw new Error();
10
11 if (result[1] !== 42)
12 throw new Error();
13
14 if (Array.prototype.join.call(result[2], ",") != "42")
15 throw new Error();
16
17 var array = [];
18 for (var s in result[2])
19 array.push(s);
20
21 if (array.join(",") != "0")
22 throw new Error();
23
24 if (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
29 if (Object.getOwnPropertyDescriptor(result[2], 0).enumerable !== true)
30 throw new Error();