Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-29.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-29
6 description: >
7 Object.defineProperty - 'name' 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, "foo", {
13 get: function() {},
14 configurable: true
15 });
16
17 var ConstructFun = function() {};
18 ConstructFun.prototype = proto;
19 var obj = new ConstructFun();
20 Object.defineProperty(obj, "foo", {
21 get: function() {},
22 configurable: false
23 });
24 assert.throws(TypeError, function() {
25 Object.defineProperty(obj, "foo", {
26 configurable: true
27 });
28 });