Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Object / defineProperties / 15.2.3.7-6-a-235.js
bloba4becc47965790b45838165ed01d4aa269be4e0d
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-235
6 description: >
7     Object.defineProperties - TypeError is thrown if 'O' is an Array,
8     'P' is an array index named property that already exists on 'O' is
9     data property with  [[Configurable]], [[Writable]] false, 'desc'
10     is data descriptor, [[Value]] field of 'desc' is +0, and the
11     [[Value]] attribute value of 'P' is -0  (15.4.5.1 step 4.c)
12 includes: [propertyHelper.js]
13 ---*/
15 var arr = [];
17 Object.defineProperty(arr, "1", {
18   value: +0
19 });
21 try {
22   Object.defineProperties(arr, {
23     "1": {
24       value: -0
25     }
26   });
27   throw new Test262Error("Expected an exception.");
28 } catch (e) {
29   verifyEqualTo(arr, "1", +0);
31   verifyNotWritable(arr, "1");
33   verifyNotEnumerable(arr, "1");
35   verifyNotConfigurable(arr, "1");
37   if (!(e instanceof TypeError)) {
38     throw new Test262Error("Expected TypeError, got " + e);
39   }
43 reportCompare(0, 0);