15.2.3.14-5-b-1.js (510B)
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-b-1 6 description: Object.keys - Verify that 'index' of returned array is ascend by 1 7 ---*/ 8 9 var obj = { 10 prop1: 100, 11 prop2: 200, 12 prop3: 300 13 }; 14 15 var array = Object.keys(obj); 16 17 var idx = 0; 18 for (var index in array) { 19 if (array.hasOwnProperty(index)) { 20 assert.sameValue(index, idx.toString(), 'index'); 21 idx++; 22 } 23 } 24 25 reportCompare(0, 0);