summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/parser/redeclaration-message.js
blob: 29de3cf7ba08a03e9989d3c3798c5bfca45cb09f (plain)
1
2
3
4
5
6
7
8
9
10
var aVar = 56;
try {
    console.log(aLet);
    let aLet = 56;
    // We cannot add `caught` variable on the toplevel for this testcase.
    // We use assertEq here to catch non-throwing case.
    assertEq(true, false);
} catch (e) {
    assertEq(e.message, "can't access lexical declaration 'aLet' before initialization");
}