Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/create/15.2.3.5-4-316.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.5-4-316
6 description: >
7 Object.create - enumerable properties of 'Properties' are given
8 numerical names (15.2.3.7 step 7)
9 ---*/
10
11 function getFunc() {
12 return 20;
13 }
14
15 function setFunc() {}
16
17 var newObj = Object.create({}, {
18 0: {
19 value: 100,
20 enumerable: true,
21 writable: true,
22 configurable: true
23 },
24 1: {
25 get: getFunc,
26 set: setFunc,
27 enumerable: true,
28 configurable: true
29 },
30 2: {
31 value: 200,
32 enumerable: true,
33 writable: true,
34 configurable: true
35 }
36 });
37
38 assert.sameValue(newObj[0], 100, 'newObj[0]');
39 assert.sameValue(newObj[1], 20, 'newObj[1]');
40 assert.sameValue(newObj[2], 200, 'newObj[2]');