Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-315-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-315-1
6 description: >
7 Object.defineProperty - 'O' is an Arguments object of a function
8 that has formal parameters, 'P' is own accessor property of 'O',
9 and 'desc' is accessor descriptor, test updating multiple
10 attribute values of 'P' (10.6 [[DefineOwnProperty]] step 3)
11 includes: [propertyHelper.js]
12 ---*/
13
14 (function(a, b, c) {
15 Object.defineProperty(arguments, "genericProperty", {
16 get: function() {
17 return 1001;
18 },
19 set: function(value) {
20 this.testgetFunction1 = value;
21 },
22 enumerable: true,
23 configurable: true
24 });
25
26 function getFunc() {
27 return "getFunctionString";
28 }
29
30 function setFunc(value) {
31 this.testgetFunction = value;
32 }
33 Object.defineProperty(arguments, "genericProperty", {
34 get: getFunc,
35 set: setFunc,
36 enumerable: false,
37 configurable: false
38 });
39 if (c !== 3) {
40 $ERROR('Expected c === 3, actually ' + c);
41 }
42
43 verifyEqualTo(arguments, "genericProperty", getFunc());
44
45 verifyWritable(arguments, "genericProperty", "testgetFunction");
46
47 verifyNotEnumerable(arguments, "genericProperty");
48
49 verifyNotConfigurable(arguments, "genericProperty");
50 }(1, 2, 3));