Debian Codegraph @

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