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-307.js
blob7b6840796d184bd26018e867b169b99ba0fcd3bf
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-307
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 [[Writable]] attribute value of 'P' which is not
10     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   writable: false,
20   configurable: false
21 });
23 try {
24   Object.defineProperties(arg, {
25     "genericProperty": {
26       writable: true
27     }
28   });
30   throw new Test262Error("Expected an exception.");
31 } catch (e) {
32   if (!(e instanceof TypeError)) {
33     throw new Test262Error("Expected TypeError, got " + e);
34   }
37 verifyProperty(arg, "genericProperty", {
38   value: undefined,
39   writable: false,
40   enumerable: false,
41   configurable: false,
42 });
44 reportCompare(0, 0);