Debian Codegraph @

js/src/tests/test262/built-ins/Object/defineProperties/15.2.3.7-6-a-69.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-69
6 description: >
7 Object.defineProperties - 'P' is data property and P.configurable
8 is true, desc is accessor property (8.12.9 step 9.b.i)
9 includes: [propertyHelper.js]
10 ---*/
11
12 var obj = {};
13
14 Object.defineProperty(obj, "foo", {
15 value: 10,
16 configurable: true
17 });
18
19 function get_Func() {
20 return 20;
21 }
22
23 Object.defineProperties(obj, {
24 foo: {
25 get: get_Func
26 }
27 });
28
29 assert.sameValue(obj.foo, 20);
30
31 var desc = Object.getOwnPropertyDescriptor(obj, "foo");
32
33 verifyProperty(obj, "foo", {
34 enumerable: false,
35 configurable: true,
36 });
37
38 assert.sameValue(typeof desc.set, "undefined", 'typeof desc.set');
39 assert.sameValue(desc.get, get_Func, 'desc.get');
40
41 reportCompare(0, 0);