configurable-attribute-own-accessor-property-set-from-true-to-false-property-are-unaltered.js (1005B)
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 esid: sec-setintegritylevel 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 throw new Test262Error('Expected preCheck to be true, actually ' + preCheck); 34 } 35 36 verifyEqualTo(obj, "foo", getFunc()); 37 38 verifyWritable(obj, "foo", "variableForHelpVerify"); 39 40 verifyProperty(obj, "foo", { 41 enumerable: true, 42 configurable: false, 43 }); 44 45 reportCompare(0, 0);