Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-196.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-196
6 description: >
7 Object.defineProperty - 'O' is an Array, 'name' is an array index
8 named property, 'name' is own accessor property that overrides an
9 inherited data property (15.4.5.1 step 4.c)
10 ---*/
11
12
13 assert.throws(TypeError, function() {
14 Object.defineProperty(Array.prototype, "0", {
15 value: 11,
16 configurable: true
17 });
18
19 var arrObj = [];
20 Object.defineProperty(arrObj, "0", {
21 get: function() {},
22 configurable: false
23 });
24
25 Object.defineProperty(arrObj, "0", {
26 configurable: true
27 });
28 });