blob: 06c2d5faf156e25ff13e5fc9e0ddee5405c8b9df [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// Copyright (c) 2012 Ecma International. All rights reserved.
2// This code is governed by the BSD license found in the LICENSE file.
3
4/*---
5es5id: 15.2.3.6-4-537
6description: >
7 ES5 Attributes - success to update [[Configurable]] attribute of
8 accessor property ([[Get]] is a Function, [[Set]] is a Function,
9 [[Enumerable]] is true, [[Configurable]] is true) to different
10 value
11includes: [propertyHelper.js]
12---*/
13
14var obj = {};
15
16var getFunc = function () {
17 return 1001;
18};
19
20var verifySetFunc = "data";
21var setFunc = function (value) {
22 verifySetFunc = value;
23};
24
25Object.defineProperty(obj, "prop", {
26 get: getFunc,
27 set: setFunc,
28 enumerable: true,
29 configurable: true
30});
31
32var desc1 = Object.getOwnPropertyDescriptor(obj, "prop");
33
34Object.defineProperty(obj, "prop", {
35 configurable: false
36});
37var desc2 = Object.getOwnPropertyDescriptor(obj, "prop");
38
39verifyNotConfigurable(obj, "prop");
40assert.sameValue(desc1.configurable, true);
41assert.sameValue(desc2.configurable, false);
42assert(obj.hasOwnProperty("prop"));