Debian Codegraph @

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