summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testManyVars.js
blob: a89d4539cf736cc4e2eee0bb64ddfafe2aea8553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
const MANY_VARS = Math.pow(2,17);

var code = "function f1() {\n";
code += "  var x0 = 0";
for (var i = 1; i < MANY_VARS; i++)
    code += ", x" + i + " = " + i;
code += ";\n";
for (var i = 0; i < MANY_VARS; i += 100)
    code += "  assertEq(x" + i + ", " + i + ");\n";
code += "  return x80000;\n";
code += "}\n";
eval(code);
assertEq(f1(), 80000);