Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/defineProperty/15.2.3.6-4-580.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.6-4-580
6 description: >
7 ES5 Attributes - Inherited property is enumerable (Boolean
8 instance)
9 ---*/
10
11 var data = "data";
12
13 Object.defineProperty(Boolean.prototype, "prop", {
14 get: function() {
15 return data;
16 },
17 set: function(value) {
18 data = value;
19 },
20 enumerable: true,
21 configurable: true
22 });
23 var boolObj = new Boolean();
24 var verifyEnumerable = false;
25 for (var p in boolObj) {
26 if (p === "prop") {
27 verifyEnumerable = true;
28 }
29 }
30
31 assert.sameValue(boolObj.hasOwnProperty("prop"), false, 'boolObj.hasOwnProperty("prop")');
32 assert(verifyEnumerable, 'verifyEnumerable !== true');