summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/keys/15.2.3.14-5-b-1.js
blob: 840621073d69ad7b7606984ded15c5fc82c85616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.14-5-b-1
description: Object.keys - Verify that 'index' of returned array is ascend by 1
---*/

var obj = {
  prop1: 100,
  prop2: 200,
  prop3: 300
};

var array = Object.keys(obj);

var idx = 0;
for (var index in array) {
  if (array.hasOwnProperty(index)) {
    assert.sameValue(index, idx.toString(), 'index');
    idx++;
  }
}

reportCompare(0, 0);