Debian Codegraph @

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