Debian Codegraph @

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