Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-6-a-6.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-6
6 description: >
7 Object.defineProperties - 'P' is inherited accessor property
8 (8.12.9 step 1 )
9 ---*/
10
11 var proto = {};
12 Object.defineProperty(proto, "prop", {
13 get: function() {
14 return 11;
15 },
16 configurable: false
17 });
18 var Con = function() {};
19 Con.prototype = proto;
20
21 var obj = new Con();
22
23 Object.defineProperties(obj, {
24 prop: {
25 get: function() {
26 return 12;
27 },
28 configurable: true
29 }
30 });
31
32 assert(obj.hasOwnProperty("prop"), 'obj.hasOwnProperty("prop") !== true');
33 assert.sameValue(obj.prop, 12, 'obj.prop');