S8.12.5_A1.js (1536B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 When the [[Put]] method of O is called with property P and value V, 7 and If O doesn't have a property with name P, then 8 creates a property with name P, set its value to V and give it empty attributes 9 es5id: 8.12.5_A1 10 description: Put to not existent properties 11 ---*/ 12 13 var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; 14 15 ////////////////////////////////////////////////////////////////////////////// 16 //CHECK#1 17 if (__map[1] !== "one") { 18 throw new Test262Error('#1: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map[1] === "one". Actual: ' + (__map[1])); 19 } 20 // 21 ////////////////////////////////////////////////////////////////////////////// 22 23 ////////////////////////////////////////////////////////////////////////////// 24 //CHECK#2 25 if (__map["two"] !== 2) { 26 throw new Test262Error('#2: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["two"] === 2. Actual: ' + (__map["two"])); 27 } 28 // 29 ////////////////////////////////////////////////////////////////////////////// 30 31 ////////////////////////////////////////////////////////////////////////////// 32 //CHECK#3 33 if (__map["3"] !== "tre") { 34 throw new Test262Error('#3: var __map={}; __map[1]="one"; __map["two"]=2; __map["3"]="tre"; __map["3"] === "tre". Actual: ' + (__map["3"])); 35 } 36 // 37 ////////////////////////////////////////////////////////////////////////////// 38 39 reportCompare(0, 0);