keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | es5id: 15.2.3.7-6-a-297 |
| 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 [[Configurable]] attribute value of 'P' which is not |
| 11 | configurable (10.6 [[DefineOwnProperty]] step 4) |
| 12 | includes: [propertyHelper.js] |
| 13 | ---*/ |
| 14 | |
| 15 | |
| 16 | var arg; |
| 17 | |
| 18 | (function fun() { |
| 19 | arg = arguments; |
| 20 | }()); |
| 21 | |
| 22 | Object.defineProperty(arg, "0", { |
| 23 | value: 0, |
| 24 | writable: false, |
| 25 | enumerable: false, |
| 26 | configurable: false |
| 27 | }); |
| 28 | |
| 29 | try { |
| 30 | Object.defineProperties(arg, { |
| 31 | "0": { |
| 32 | configurable: true |
| 33 | } |
| 34 | }); |
| 35 | |
| 36 | $ERROR("Expected an exception."); |
| 37 | } catch (e) { |
| 38 | verifyEqualTo(arg, "0", 0); |
| 39 | |
| 40 | verifyNotWritable(arg, "0"); |
| 41 | |
| 42 | verifyNotEnumerable(arg, "0"); |
| 43 | |
| 44 | verifyNotConfigurable(arg, "0"); |
| 45 | |
| 46 | if (!(e instanceof TypeError)) { |
| 47 | $ERROR("Expected TypeError, got " + e); |
| 48 | } |
| 49 | |
| 50 | } |