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-294.js
blobe1af163e2b85b2550e5c986da827a20111a6f8eb
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-294
6 description: >
7     Object.defineProperties - 'O' is an Arguments object, 'P' is an
8     array index named data property of 'O' but not defined in
9     [[ParameterMap]] of 'O', test TypeError is thrown when updating
10     the [[Value]] attribute value of 'P' which is not writable and not
11     configurable (10.6 [[DefineOwnProperty]] step 4)
12 includes: [propertyHelper.js]
13 ---*/
16 var arg;
18 (function fun() {
19   arg = arguments;
20 }());
22 Object.defineProperty(arg, "0", {
23   value: 0,
24   writable: false,
25   configurable: false
26 });
28 try {
29   Object.defineProperties(arg, {
30     "0": {
31       value: 10
32     }
33   });
35   throw new Test262Error("Expected an exception.");
36 } catch (e) {
37   verifyEqualTo(arg, "0", 0);
39   verifyNotWritable(arg, "0");
41   verifyNotEnumerable(arg, "0");
43   verifyNotConfigurable(arg, "0");
45   if (!(e instanceof TypeError)) {
46     throw new Test262Error("Expected TypeError, got " + e);
47   }
51 reportCompare(0, 0);