Debian Codegraph @

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