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-82-23.js
blob8c9693671f918cc27437e63cad41bb193bcd6073
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-82-23
6 description: >
7     Object.defineProperty - Update [[Enumerable]] and [[Configurable]]
8     attributes of 'name' property to false successfully when
9     [[Enumerable]] and [[Configurable]] attributes of 'name' property
10     are true,  the 'desc' is a generic descriptor which contains
11     [[Enumerable]] and [[Configurable]] attributes as false, 'name'
12     property is an index accessor property (8.12.9 step 8)
13 includes: [propertyHelper.js]
14 ---*/
17 var obj = {};
18 obj.verifySetFunction = "data";
19 var get_func = function() {
20   return obj.verifySetFunction;
22 var set_func = function(value) {
23   obj.verifySetFunction = value;
25 Object.defineProperty(obj, "0", {
26   get: get_func,
27   set: set_func,
28   enumerable: true,
29   configurable: true
30 });
32 Object.defineProperty(obj, "0", {
33   enumerable: false,
34   configurable: false
35 });
37 verifyEqualTo(obj, "0", get_func());
39 verifyWritable(obj, "0", "verifySetFunction");
41 verifyProperty(obj, "0", {
42   enumerable: false,
43   configurable: false,
44 });
46 reportCompare(0, 0);