Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/seal/15.2.3.8-2-b-3.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.8-2-b-3
6 description: >
7 Object.seal - the [[Configurable]] attribute of all own properties
8 of 'O' are set from true to false and other attributes of the
9 property are unaltered
10 includes: [propertyHelper.js]
11 ---*/
12
13 var obj = {};
14 obj.variableForHelpVerify = "data";
15
16 Object.defineProperty(obj, "foo1", {
17 value: 10,
18 writable: true,
19 enumerable: true,
20 configurable: true
21 });
22
23 function set_func(value) {
24 obj.variableForHelpVerify = value;
25 }
26
27 function get_func() {
28 return 10;
29 }
30 Object.defineProperty(obj, "foo2", {
31 get: get_func,
32 set: set_func,
33 enumerable: true,
34 configurable: true
35 });
36 var preCheck = Object.isExtensible(obj);
37 Object.seal(obj);
38
39 if (!preCheck) {
40 $ERROR('Expected preCheck to be true, actually ' + preCheck);
41 }
42
43
44 verifyEqualTo(obj, "foo1", 10);
45
46 verifyWritable(obj, "foo1");
47
48 verifyEnumerable(obj, "foo1");
49
50 verifyNotConfigurable(obj, "foo1");
51
52 verifyEqualTo(obj, "foo2", get_func());
53
54 verifyWritable(obj, "foo2", "variableForHelpVerify");
55
56 verifyEnumerable(obj, "foo2");
57
58 verifyNotConfigurable(obj, "foo2");