summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug1147216.js
blob: d683d713f6ea401a63b92a8587205a25358f46df (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
// Ensure JSOP_LINENO (emitted after JSOP_EVAL) handles big line
// numbers correctly.
function getsource() {
    var s = "";
    for (var i=0; i<66002; i++) {
	s += "\n";
	if (i === 66000)
	    s += "eval('stack = Error().stack');";
    }
    return s;
}
function test() {
    var stack;
    eval(getsource());
    assertEq(stack.indexOf("line 66002") > 0, true);
}
test();

function testStrict() {
    "use strict";
    var stack;
    eval(getsource());
    assertEq(stack.indexOf("line 66002") > 0, true);
}
testStrict();