OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 function array_store_5(a,b,c) { | 93 function array_store_5(a,b,c) { |
94 return (a[b] = c); | 94 return (a[b] = c); |
95 } | 95 } |
96 | 96 |
97 a = makeCOW(); | 97 a = makeCOW(); |
98 array_store_5(a, 1, 0.5); | 98 array_store_5(a, 1, 0.5); |
99 a = makeCOW(); | 99 a = makeCOW(); |
100 array_store_5(a, 1, 0.5); | 100 array_store_5(a, 1, 0.5); |
101 assertEquals(0.5, a[1]); | 101 assertEquals(0.5, a[1]); |
102 assertEquals(0.5, array_store_5([], 1, 0.5)); | 102 a = []; |
| 103 assertEquals(0.5, array_store_5(a, 1, 0.5)); |
| 104 assertEquals(undefined, a[0]); |
| 105 assertEquals(0.5, a[1]); |
103 | 106 |
104 function array_store_6(a,b,c) { | 107 function array_store_6(a,b,c) { |
105 return (a[b] = c); | 108 return (a[b] = c); |
106 } | 109 } |
107 | 110 |
108 a = makeCOW(); | 111 a = makeCOW(); |
109 array_store_6(a, 1, x); | 112 array_store_6(a, 1, x); |
110 a = makeCOW(); | 113 a = makeCOW(); |
111 array_store_6(a, 1, x); | 114 array_store_6(a, 1, x); |
112 assertEquals(x, a[1]); | 115 assertEquals(x, a[1]); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 function array_store_9(a,b,c) { | 177 function array_store_9(a,b,c) { |
175 return (a[b] = c); | 178 return (a[b] = c); |
176 } | 179 } |
177 | 180 |
178 var a = []; | 181 var a = []; |
179 array_store_9(a, 0, 0.5); | 182 array_store_9(a, 0, 0.5); |
180 a = []; | 183 a = []; |
181 array_store_1(a, 0, 0.5); | 184 array_store_1(a, 0, 0.5); |
182 assertEquals(0.5, a[0]); | 185 assertEquals(0.5, a[0]); |
183 assertEquals(0.5, array_store_1([], 0, 0.5)); | 186 assertEquals(0.5, array_store_1([], 0, 0.5)); |
OLD | NEW |