Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperties / 15.2.3.7-6-a-227.js
blob2df44c3abe79a9a9646e5258530bf7765f5d016e
1 // Copyright (c) 2012 Ecma International.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 es5id: 15.2.3.7-6-a-227
6 description: >
7     Object.defineProperties - 'O' is an Array, 'P' is an array index
8     property, TypeError is thrown if the [[Configurable]] attribute
9     value of 'P' is false  and the [[Configurable]] field of 'desc' is
10     true  (15.4.5.1 step 4.c)
11 includes: [propertyHelper.js]
12 ---*/
15 var arr = [];
17 Object.defineProperty(arr, "1", {
18   value: 3,
19   configurable: false
20 });
22 try {
23   Object.defineProperties(arr, {
24     "1": {
25       value: 13,
26       configurable: true
27     }
28   });
29 } catch (e) {
30   if (!(e instanceof TypeError)) {
31     throw new Test262Error("Expected TypeError, got " + e);
32   }
35 verifyProperty(arr, "1", {
36   value: 3,
37   writable: false,
38   enumerable: false,
39   configurable: false,
40 });
42 reportCompare(0, 0);