Debian Codegraph @

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