ggaren@apple.com | 961dc37 | 2015-09-04 02:39:20 +0000 | [diff] [blame] | 1 | function test() { |
2 | |||||
3 | var obj = { | ||||
4 | 2: true, | ||||
5 | 0: true, | ||||
6 | 1: true, | ||||
7 | ' ': true, | ||||
8 | 9: true, | ||||
9 | D: true, | ||||
10 | B: true, | ||||
11 | '-1': true, | ||||
12 | }; | ||||
13 | obj.A = true; | ||||
14 | obj[3] = true; | ||||
15 | Object.defineProperty(obj, 'C', { value: true, enumerable: true }); | ||||
16 | Object.defineProperty(obj, '4', { value: true, enumerable: true }); | ||||
17 | delete obj[2]; | ||||
18 | obj[2] = true; | ||||
19 | |||||
20 | return Object.keys(obj).join('') === "012349 DB-1AC"; | ||||
21 | |||||
22 | } | ||||
23 | |||||
24 | if (!test()) | ||||
25 | throw new Error("Test failed"); | ||||
26 |