Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Object/keys/15.2.3.14-6-3.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-6-3
6 description: >
7 Object.keys - the order of elements in returned array is the same
8 with the order of properties in 'O' (String object)
9 ---*/
10
11 var str = new String("abc");
12
13 var tempArray = [];
14 for (var p in str) {
15 if (str.hasOwnProperty(p)) {
16 tempArray.push(p);
17 }
18 }
19
20 var returnedArray = Object.keys(str);
21
22 for (var index in returnedArray) {
23 assert.sameValue(tempArray[index], returnedArray[index], 'tempArray[index]');
24 }