| 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.6-4-376 |
| 6 |
description: > |
| 7 |
ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] |
| 8 |
is false, [[Configurable]] is false) is non-enumerable |
| 9 |
---*/ |
| 10 |
|
| 11 |
var obj = {}; |
| 12 |
|
| 13 |
Object.defineProperty(obj, "prop", { |
| 14 |
value: 2010, |
| 15 |
writable: false, |
| 16 |
enumerable: false, |
| 17 |
configurable: false |
| 18 |
}); |
| 19 |
var propertyDefineCorrect = obj.hasOwnProperty("prop"); |
| 20 |
var desc = Object.getOwnPropertyDescriptor(obj, "prop"); |
| 21 |
for (var p in obj) { |
| 22 |
assert.notSameValue(p, "prop", 'p'); |
| 23 |
} |
| 24 |
|
| 25 |
assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); |
| 26 |
assert.sameValue(desc.enumerable, false, 'desc.enumerable'); |