| 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-48 |
| 6 |
description: > |
| 7 |
Object.getOwnPropertyNames - own accessor property of Array object |
| 8 |
'O' is pushed into the returned array. |
| 9 |
---*/ |
| 10 |
|
| 11 |
var propertyFound = false; |
| 12 |
|
| 13 |
var arr = [0, 1, 2]; |
| 14 |
|
| 15 |
Object.defineProperty(arr, "ownProperty", { |
| 16 |
get: function() { |
| 17 |
return "ownArray"; |
| 18 |
}, |
| 19 |
configurable: true |
| 20 |
}); |
| 21 |
|
| 22 |
var result = Object.getOwnPropertyNames(arr); |
| 23 |
|
| 24 |
for (var p in result) { |
| 25 |
if (result[p] === "ownProperty") { |
| 26 |
propertyFound = true; |
| 27 |
break; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
assert(propertyFound, 'Property not found'); |