| 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-a-3 |
| 6 |
description: > |
| 7 |
Object.keys - 'enumerable' attribute of element of returned array |
| 8 |
is correct |
| 9 |
---*/ |
| 10 |
|
| 11 |
var obj = { |
| 12 |
prop1: 100 |
| 13 |
}; |
| 14 |
|
| 15 |
var array = Object.keys(obj); |
| 16 |
var desc = Object.getOwnPropertyDescriptor(array, "0"); |
| 17 |
var result = false; |
| 18 |
for (var index in array) { |
| 19 |
if (obj.hasOwnProperty(array[index]) && array[index] === "prop1") { |
| 20 |
result = true; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
assert(result, 'result !== true'); |
| 25 |
assert(desc.hasOwnProperty("enumerable"), 'desc.hasOwnProperty("enumerable") !== true'); |
| 26 |
assert.sameValue(desc.enumerable, true, 'desc.enumerable'); |