Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperties/15.2.3.7-5-b-143.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.7-5-b-143
6 description: >
7 Object.defineProperties - 'writable' property of 'descObj' is own
8 data property that overrides an inherited accessor property
9 (8.10.5 step 6.a)
10 includes: [propertyHelper.js]
11 ---*/
12
13 var obj = {};
14
15 var proto = {
16 value: 120
17 };
18
19 Object.defineProperty(proto, "writable", {
20 get: function() {
21 return true;
22 }
23 });
24
25 var Con = function() {};
26 Con.prototype = proto;
27
28 var descObj = new Con();
29
30 Object.defineProperty(descObj, "writable", {
31 value: false
32 });
33
34 Object.defineProperties(obj, {
35 property: descObj
36 });
37
38 assert(obj.hasOwnProperty("property"));
39 verifyNotWritable(obj, "property");