Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/getOwnPropertyDescriptor/15.2.3.3-3-4.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.3-3-4
6 description: >
7 Object.getOwnPropertyDescriptor - 'P' is own data property that
8 overrides an inherited accessor property
9 ---*/
10
11 var proto = {};
12 Object.defineProperty(proto, "property", {
13 get: function() {
14 return "inheritedDataProperty";
15 },
16 configurable: true
17 });
18
19 var Con = function() {};
20 Con.ptototype = proto;
21
22 var child = new Con();
23 Object.defineProperty(child, "property", {
24 value: "ownDataProperty",
25 configurable: true
26 });
27
28 var desc = Object.getOwnPropertyDescriptor(child, "property");
29
30 assert.sameValue(desc.value, "ownDataProperty", 'desc.value');