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-283.js
blobccdf0405538435e63f32f6e1126314ab1a4a417a
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-283
6 description: >
7     Object.defineProperties - 'O' is an Arguments object, 'P' is own
8     data property of 'O' which is also defined in [[ParameterMap]] of
9     'O', test TypeError is thrown when updating the [[Writable]]
10     attribute value of 'P' which is defined as non-configurable (10.6
11     [[DefineOwnProperty]] step 4)
12 includes: [propertyHelper.js]
13 ---*/
16 var arg;
18 (function fun(a, b, c) {
19   arg = arguments;
20 }(0, 1, 2));
22 Object.defineProperty(arg, "0", {
23   value: 0,
24   writable: false,
25   enumerable: false,
26   configurable: false
27 });
29 try {
30   Object.defineProperties(arg, {
31     "0": {
32       writable: true
33     }
34   });
36   throw new Test262Error("Expected an exception.");
37 } catch (e) {
38   if (!(e instanceof TypeError)) {
39     throw new Test262Error("Expected TypeError, got " + e);
40   }
43 verifyProperty(arg, "0", {
44   value: 0,
45   writable: false,
46   enumerable: false,
47   configurable: false,
48 });
50 reportCompare(0, 0);