Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/assignment/S8.12.5_A2.js

raw
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 then set the value of the property to V. The attributes of the property are not changed
8 es5id: 8.12.5_A2
9 description: Put to existent properties
10 ---*/
11
12 var _map={1:"one",two:2};
13
14 //////////////////////////////////////////////////////////////////////////////
15 //CHECK#1
16 _map[1]="uno";
17 if (_map[1] !== "uno") {
18 $ERROR('#1: var _map={1:"one",two:2}; _map[1]="uno"; _map[1] === "uno". Actual: ' + (_map[1]));
19 }
20 //
21 //////////////////////////////////////////////////////////////////////////////
22
23 //////////////////////////////////////////////////////////////////////////////
24 //CHECK#2
25 _map["1"]=1;
26 if (_map[1] !== 1) {
27 $ERROR('#2: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map[1] === 1. Actual: ' + (_map[1]));
28 }
29 //
30 //////////////////////////////////////////////////////////////////////////////
31
32 //////////////////////////////////////////////////////////////////////////////
33 //CHECK#3
34 _map["two"]="two";
35 if (_map["two"] !== "two") {
36 $ERROR('#3: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map["two"] === "two". Actual: ' + (_map["two"]));
37 }
38 //
39 //////////////////////////////////////////////////////////////////////////////
40
41 //////////////////////////////////////////////////////////////////////////////
42 //CHECK#4
43 _map.two="duo";
44 if (_map.two !== "duo") {
45 $ERROR('#4: var _map={1:"one",two:2}; _map[1]="uno"; _map["1"]=1; _map["two"]="two"; _map.two="duo"; _map.two === "duo". Actual: ' + (_map.two));
46 }
47 //
48 //////////////////////////////////////////////////////////////////////////////