Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/freeze/15.2.3.9-2-a-5.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.9-2-a-5
6 description: >
7 Object.freeze - 'P' is own accessor property that overrides an
8 inherited data property
9 includes: [propertyHelper.js]
10 ---*/
11
12
13 var proto = {};
14
15 proto.foo = 0; // default [[Configurable]] attribute value of foo: true
16
17 var Con = function() {};
18 Con.prototype = proto;
19
20 var child = new Con();
21
22 Object.defineProperty(child, "foo", {
23 get: function() {
24 return 10;
25 },
26 configurable: true
27 });
28
29 Object.freeze(child);
30
31 verifyNotConfigurable(child, "foo");
32 assert.sameValue(child.foo, 10);