15.2.3.7-6-a-187.js (720B)
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.7-6-a-187 6 description: > 7 Object.defineProperties - 'O' is an Array, 'P' is an array index 8 named property, 'P' is inherited data property (15.4.5.1 step 4.c) 9 ---*/ 10 11 Object.defineProperty(Array.prototype, "0", { 12 value: 11, 13 configurable: true 14 }); 15 16 var arr = []; 17 18 Object.defineProperties(arr, { 19 "0": { 20 configurable: false 21 } 22 }); 23 24 assert(arr.hasOwnProperty("0"), 'arr.hasOwnProperty("0") !== true'); 25 assert.sameValue(typeof arr[0], "undefined", 'typeof arr[0]'); 26 assert.sameValue(Array.prototype[0], 11, 'Array.prototype[0]'); 27 28 reportCompare(0, 0);