| 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.8-2-b-1 |
| 6 |
description: > |
| 7 |
Object.seal - the [[Configurable]] attribute of own data property |
| 8 |
of 'O' is set from true to false and other attributes of the |
| 9 |
property are unaltered |
| 10 |
includes: [propertyHelper.js] |
| 11 |
---*/ |
| 12 |
|
| 13 |
var obj = {}; |
| 14 |
|
| 15 |
Object.defineProperty(obj, "foo", { |
| 16 |
value: 10, |
| 17 |
writable: true, |
| 18 |
enumerable: true, |
| 19 |
configurable: true |
| 20 |
}); |
| 21 |
var preCheck = Object.isExtensible(obj); |
| 22 |
Object.seal(obj); |
| 23 |
|
| 24 |
if (!preCheck) { |
| 25 |
$ERROR('Expected preCheck to be true, actually ' + preCheck); |
| 26 |
} |
| 27 |
|
| 28 |
verifyEqualTo(obj, "foo", 10); |
| 29 |
|
| 30 |
verifyWritable(obj, "foo"); |
| 31 |
|
| 32 |
verifyEnumerable(obj, "foo"); |
| 33 |
|
| 34 |
verifyNotConfigurable(obj, "foo"); |