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