Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-291-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-291-1
6 description: >
7 Object.defineProperty - 'O' is an Arguments object of a function
8 that has formal parameters, 'name' is own accessor property of 'O'
9 which is also defined in [[ParameterMap]] of 'O', and 'desc' is
10 accessor descriptor, test updating multiple attribute values of
11 'name' (10.6 [[DefineOwnProperty]] step 3 and 5.a.i)
12 includes: [propertyHelper.js]
13 ---*/
14
15 (function(a, b, c) {
16 function getFunc1() {
17 return 10;
18 }
19 Object.defineProperty(arguments, "0", {
20 get: getFunc1,
21 enumerable: true,
22 configurable: true
23 });
24
25 function getFunc2() {
26 return 20;
27 }
28 Object.defineProperty(arguments, "0", {
29 get: getFunc2,
30 enumerable: false,
31 configurable: false
32 });
33 if (a !== 0) {
34 $ERROR('Expected a === 0, actually ' + a);
35 }
36
37 verifyEqualTo(arguments, "0", getFunc2());
38
39 verifyNotEnumerable(arguments, "0");
40
41 verifyNotConfigurable(arguments, "0");
42 }(0, 1, 2));