Debian Codegraph @

js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-36.js

raw
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 es5id: 15.2.3.7-6-a-36
6 description: >
7 Object.defineProperties - 'P' doesn't exist in 'O', test
8 [[Configurable]] of 'P' is set as false value if absent in
9 accessor descriptor 'desc' (8.12.9 step 4.b.i)
10 includes: [propertyHelper.js]
11 ---*/
12
13 var obj = {};
14 var getFun = function() {
15 return 10;
16 };
17 var setFun = function(value) {
18 obj.setVerifyHelpProp = value;
19 };
20
21 Object.defineProperties(obj, {
22 prop: {
23 set: setFun,
24 get: getFun,
25 enumerable: true
26 }
27 });
28
29 verifyEqualTo(obj, "prop", 10);
30
31 verifyWritable(obj, "prop", "setVerifyHelpProp");
32
33 verifyProperty(obj, "prop", {
34 enumerable: true,
35 configurable: false,
36 });
37
38 reportCompare(0, 0);