Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/getOwnPropertyNames/15.2.3.4-4-42.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.4-4-42
6 description: >
7 Object.getOwnPropertyNames - own data property of String object
8 'O' is pushed into the returned array
9 ---*/
10
11 var propertyFound = false;
12
13 var str = new String("abc");
14
15 Object.defineProperty(str, "ownProperty", {
16 value: "ownString",
17 configurable: true
18 });
19
20 var result = Object.getOwnPropertyNames(str);
21
22 for (var p in result) {
23 if (result[p] === "ownProperty") {
24 propertyFound = true;
25 break;
26 }
27 }
28
29 assert(propertyFound, 'Property not found');