Debian Codegraph @

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