summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/megamorphic-null-and-undefined.js
blob: 5f7f804a3128e780fec054e71d8f97fe1906cf2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
let objs = [];

for (let i = 0; i < 100; i++) {
  let obj = {};
  obj["x" + i] = 1;
  obj[undefined] = 2;
  obj[null] = 3;
  objs.push(obj);
}

function foo(obj) {
  assertEq(obj[undefined], 2);
  assertEq(obj[null], 3);
}

for (let i = 0; i < 100; i++) {
  foo(objs[i]);
}