Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/keys/15.2.3.14-5-16.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.14-5-16
6 description: >
7 Object.keys - own enumerable indexed accessor property of String
8 object 'O' is defined in returned array
9 ---*/
10
11 var obj = new String("xyz");
12 obj[-20] = -20;
13 obj[20] = 20;
14
15 Object.defineProperty(obj, "prop1", {
16 get: function() {},
17 enumerable: true,
18 configurable: true
19 });
20 Object.defineProperty(obj, "prop2", {
21 get: function() {},
22 enumerable: false,
23 configurable: true
24 });
25
26 var arr = Object.keys(obj);
27
28 for (var i = 0; i < arr.length; i++) {
29 assert(obj.hasOwnProperty(arr[i]), 'obj.hasOwnProperty(arr[i]) !== true');
30 }