Debian Codegraph @

js/src/tests/test262/built-ins/Object/create/15.2.3.5-4-315.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-315
6 description: >
7 Object.create - all properties in 'Properties' are enumerable
8 (data property and accessor property) (15.2.3.7 step 7)
9 includes: [propertyHelper.js]
10 ---*/
11
12 var newObj = {};
13
14 function getFunc() {
15 return 10;
16 }
17
18 function setFunc(value) {
19 newObj.setVerifyHelpProp = value;
20 }
21
22 newObj = Object.create({}, {
23 foo1: {
24 value: 200,
25 enumerable: true,
26 writable: true,
27 configurable: true
28 },
29 foo2: {
30 get: getFunc,
31 set: setFunc,
32 enumerable: true,
33 configurable: true
34 }
35 });
36
37 verifyProperty(newObj, "foo1", {
38 value: 200,
39 writable: true,
40 enumerable: true,
41 configurable: true,
42 });
43
44 verifyEqualTo(newObj, "foo2", getFunc());
45
46 verifyWritable(newObj, "foo2", "setVerifyHelpProp");
47
48 verifyProperty(newObj, "foo2", {
49 enumerable: true,
50 configurable: true,
51 });
52
53 reportCompare(0, 0);