blob: 91fb50f50ef91182b298bf87f204ddd474e5b54d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
var a = [1, 2];
a[3.1415926535] = 'value';
for (var i = 0; i < 3; i++) {
var attr;
switch (i) {
case 0: attr = 0; break;
case 1: attr = 1; break;
case 2: attr = 3.1415926535; break;
}
var result = a[attr];
switch (i) {
case 0: assertEq(result, 1); break;
case 1: assertEq(result, 2); break;
case 2: assertEq(result, 'value'); break;
}
}
/* int32_t and string getelem for non-dense array. */
|