summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug511241.js
blob: fe28febb93f14e73af2d9d8970e5ad87c0c03341 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var d = 1;
function heavy(x) {
    eval(x);
    return function lite() {
        var s = 0;
        for (var i = 0; i < 9; i++)
            s += d;
        return s;
    };
}

var f1 = heavy("1");
var f2 = heavy("var d = 100;");
assertEq(f1(), 9);
assertEq(f2(), 900);