keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | es5id: 15.2.3.14-5-2 |
| 6 | description: > |
| 7 | Object.keys - own enumerable accessor property of 'O' is defined |
| 8 | in returned array |
| 9 | ---*/ |
| 10 | |
| 11 | var obj = { }; |
| 12 | |
| 13 | Object.defineProperty(obj, "prop", { |
| 14 | get: function () { |
| 15 | return 1003; |
| 16 | }, |
| 17 | enumerable: true, |
| 18 | configurable: true |
| 19 | }); |
| 20 | |
| 21 | var arr = Object.keys(obj); |
| 22 | |
| 23 | assert(arr.hasOwnProperty(0), 'arr.hasOwnProperty(0) !== true'); |
| 24 | assert.sameValue(arr[0], "prop", 'arr[0]'); |