summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/recompile/getelem.js
blob: 1c976ac7ee97f3b0d9dffd16e0f608cc173b67cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

/* Unexpected values out of GETELEM */

function foo() {
  var x = [1,2,3];
  var y;
  var z = x[y];
  y = 10;
  assertEq(z, "twelve");
}
Array.prototype["undefined"] = "twelve";
foo();

function fna() {
  var a = {};
  a[true] = 1;
  assertEq(a["true"], 1);
}
fna();

function fnb() {
  var a = [];
  a[1.1] = 2;
  assertEq(a["1.1"], 2);
}
fnb();