Debian Codegraph @

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