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-229.js
blob08df4167f5419f93cb9b589b3ef12e0325eec5a8
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-229
6 description: >
7     Object.defineProperties - 'O' is an Array, 'P' is an array index
8     property, TypeError is thrown if 'P' is accessor property, and
9     'desc' is data descriptor, and the [[Configurable]] attribute
10     value of 'P' is false  (15.4.5.1 step 4.c)
11 includes: [propertyHelper.js]
12 ---*/
15 var arr = [];
17 function set_fun(value) {
18   arr.setVerifyHelpProp = value;
21 Object.defineProperty(arr, "1", {
22   set: set_fun,
23   configurable: false
25 });
27 try {
28   Object.defineProperties(arr, {
29     "1": {
30       value: 13
31     }
32   });
33   throw new Test262Error("Expected an exception.");
35 } catch (e) {
36   verifyWritable(arr, "1", "setVerifyHelpProp");
38   if (!(e instanceof TypeError)) {
39     throw new Test262Error("Expected TypeError, got " + e);
40   }
43 verifyProperty(arr, "1", {
44   enumerable: false,
45   configurable: false,
46 });
48 reportCompare(0, 0);