Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperty / 15.2.3.6-4-531-10.js
blob50dbf751f4c14f303f677684b957dcdc6e9cdc38
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-10
6 description: >
7     Object.defineProperty will update [[Get]] and [[Set]] attributes
8     of indexed accessor property 'P' successfully when
9     [[Configurable]] attribute is true, 'O' is an Object object
10     (8.12.9 step 11)
11 includes: [propertyHelper.js]
12 ---*/
15 var obj = {};
17 obj.verifySetFunction = "data";
18 Object.defineProperty(obj, "0", {
19   get: function() {
20     return obj.verifySetFunction;
21   },
22   set: function(value) {
23     obj.verifySetFunction = value;
24   },
25   configurable: true
26 });
28 obj.verifySetFunction1 = "data1";
29 var getFunc = function() {
30   return obj.verifySetFunction1;
32 var setFunc = function(value) {
33   obj.verifySetFunction1 = value;
36 Object.defineProperty(obj, "0", {
37   get: getFunc,
38   set: setFunc
39 });
41 verifyEqualTo(obj, "0", getFunc());
43 verifyWritable(obj, "0", "verifySetFunction1");
45 verifyNotEnumerable(obj, "0");
47 verifyConfigurable(obj, "0");
49 reportCompare(0, 0);