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-306.js
blob7fa55bce0e264b67d3452a06227980e021103e87
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-306
6 description: >
7     Object.defineProperties - 'O' is an Arguments object, 'P' is
8     generic own data property of 'O', test TypeError is thrown when
9     updating the [[Value]] attribute value of 'P' which is not
10     writable and not configurable (10.6 [[DefineOwnProperty]] step 4)
11 includes: [propertyHelper.js]
12 ---*/
14 var arg = (function() {
15   return arguments;
16 }(1, 2, 3));
18 Object.defineProperty(arg, "genericProperty", {
19   value: 1001,
20   writable: false,
21   configurable: false
22 });
24 try {
25   Object.defineProperties(arg, {
26     "genericProperty": {
27       value: 1002
28     }
29   });
31   throw new Test262Error("Expected an exception.");
32 } catch (e) {
33   if (!(e instanceof TypeError)) {
34     throw new Test262Error("Expected TypeError, got " + e);
35   }
38 verifyProperty(arg, "genericProperty", {
39   value: 1001,
40   writable: false,
41   enumerable: false,
42   configurable: false,
43 });
45 reportCompare(0, 0);