Debian Codegraph @

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