Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-34.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-34
6 description: >
7 Object.defineProperties - 'P' doesn't exist in 'O', test [[Set]]
8 of 'P' is set as undefined value if absent in accessor descriptor
9 'desc' (8.12.9 step 4.b.i)
10 ---*/
11
12 var obj = {};
13 var getFunc = function() {
14 return 10;
15 };
16
17 Object.defineProperties(obj, {
18 prop: {
19 get: getFunc,
20 enumerable: true,
21 configurable: true
22 }
23 });
24
25 var desc = Object.getOwnPropertyDescriptor(obj, "prop");
26
27 assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
28 assert.sameValue(typeof(desc.set), "undefined", 'typeof (desc.set)');