blob: 928d08c94c344ec48ef0d5784297b78b4cf3e20a [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var string = ``;
string += `var res = 0;\n`;
for (var i = 0; i < 5e4; ++i) {
string += `res += ${i};\n`
}
string += `return res;`
var f = new Function(string);
shouldBe(f(), 1249975000);