Debian Codegraph @

js/src/tests/test262/built-ins/Object/defineProperty/15.2.3.6-4-317-1.js

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