Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperty / 15.2.3.6-4-283.js
blobc106eef000ef121db4d8a88eb3ec8c6b09b69c2a
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.6-4-283
6 description: >
7     Object.defineProperty - 'O' is an Array, 'name' is generic own
8     data property of 'O', test TypeError is thrown when updating the
9     [[Enumerable]] attribute value of 'name' which is defined as
10     non-configurable (15.4.5.1 step 5)
11 includes: [propertyHelper.js]
12 ---*/
14 var arrObj = [];
16 Object.defineProperty(arrObj, "property", {
17   value: 12,
18   enumerable: false
19 });
20 try {
21   Object.defineProperty(arrObj, "property", {
22     enumerable: true
23   });
24   throw new Test262Error("Expected an exception.");
25 } catch (e) {
26   if (!(e instanceof TypeError)) {
27     throw new Test262Error("Expected TypeError, got " + e);
28   }
31 verifyProperty(arrObj, "property", {
32   value: 12,
33   writable: false,
34   enumerable: false,
35   configurable: false,
36 });
38 reportCompare(0, 0);