| 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.4-4-b-2 |
| 6 |
description: > |
| 7 |
Object.getOwnPropertyNames - all own properties are pushed into |
| 8 |
the returned array |
| 9 |
includes: [compareArray.js] |
| 10 |
---*/ |
| 11 |
|
| 12 |
var obj = { |
| 13 |
"a": "a" |
| 14 |
}; |
| 15 |
|
| 16 |
Object.defineProperty(obj, "b", { |
| 17 |
get: function() { |
| 18 |
return "b"; |
| 19 |
}, |
| 20 |
enumerable: false, |
| 21 |
configurable: true |
| 22 |
}); |
| 23 |
|
| 24 |
Object.defineProperty(obj, "c", { |
| 25 |
get: function() { |
| 26 |
return "c"; |
| 27 |
}, |
| 28 |
enumerable: true, |
| 29 |
configurable: true |
| 30 |
}); |
| 31 |
|
| 32 |
Object.defineProperty(obj, "d", { |
| 33 |
value: "d", |
| 34 |
enumerable: false, |
| 35 |
configurable: true |
| 36 |
}); |
| 37 |
|
| 38 |
var actual = Object.getOwnPropertyNames(obj); |
| 39 |
var expected = ["a", "b", "c", "d"]; |
| 40 |
|
| 41 |
assert(compareArray(actual, expected), 'compareArray(actual, expected) !== true'); |