Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperty / 15.2.3.6-4-531-1.js
blob832606854144f70862d32ed35044753a4589aee1
1 // Copyright (c) 2012 Ecma International.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 es5id: 15.2.3.6-4-531-1
6 description: >
7     Object.defineProperty will update [[Get]] and [[Set]] attributes
8     of named accessor property 'P' successfully when [[Configurable]]
9     attribute is true, 'O' is an Object object (8.12.9 step 11)
10 includes: [propertyHelper.js]
11 ---*/
14 var obj = {};
15 obj.verifySetFunction = "data";
16 Object.defineProperty(obj, "property", {
17   get: function() {
18     return obj.verifySetFunction;
19   },
20   set: function(value) {
21     obj.verifySetFunction = value;
22   },
23   configurable: true
24 });
26 obj.verifySetFunction1 = "data1";
27 var getFunc = function() {
28   return obj.verifySetFunction1;
30 var setFunc = function(value) {
31   obj.verifySetFunction1 = value;
34 Object.defineProperty(obj, "property", {
35   get: getFunc,
36   set: setFunc
37 });
39 verifyEqualTo(obj, "property", getFunc());
41 verifyWritable(obj, "property", "verifySetFunction1");
43 verifyProperty(obj, "property", {
44   enumerable: false,
45   configurable: true,
46 });
48 reportCompare(0, 0);