15.2.3.14-3-7.js (659B)
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-3-7 6 description: > 7 Object.keys - length of the returned array equals the number of 8 own enumerable properties of 'O' 9 ---*/ 10 11 var obj = { 12 prop1: 1001, 13 prop2: 1002 14 }; 15 16 Object.defineProperty(obj, "prop3", { 17 value: 1003, 18 enumerable: true, 19 configurable: true 20 }); 21 22 Object.defineProperty(obj, "prop4", { 23 get: function() { 24 return 1003; 25 }, 26 enumerable: false, 27 configurable: true 28 }); 29 30 var arr = Object.keys(obj); 31 32 assert.sameValue(arr.length, 3, 'arr.length'); 33 34 reportCompare(0, 0);