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-276.js
blobcc4b257824a440db2579ea554f7422145f0a7b51
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-276
6 description: >
7     Object.defineProperties - 'O' is an Array, 'P' is generic own
8     accessor property of 'O', test TypeError is thrown when updating
9     the [[Enumerable]] attribute value of 'P' which is defined as
10     non-configurable (15.4.5.1 step 5)
11 includes: [propertyHelper.js]
12 ---*/
15 var arr = [];
17 function set_fun(value) {
18   arr.setVerifyHelpProp = value;
20 Object.defineProperty(arr, "property", {
21   set: set_fun,
22   enumerable: false
23 });
25 try {
26   Object.defineProperties(arr, {
27     "property": {
28       enumerable: true
29     }
30   });
31   throw new Test262Error("Expected an exception.");
32 } catch (e) {
33   verifyWritable(arr, "property", "setVerifyHelpProp");
35   if (!(e instanceof TypeError)) {
36     throw new Test262Error("Expected TypeError, got " + e);
37   }
40 verifyProperty(arr, "property", {
41   enumerable: false,
42   configurable: false,
43 });
45 reportCompare(0, 0);