summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/syntax/bug1863308.js
blob: e7a822d310096762eafebfe9a4111e1abfa1bd3d (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
26
27
28
29
30
31
32
33
34
35
try {
    eval("for (let case of ['foo', 'bar']) {}")
}
catch(e) {
    assertEq(e instanceof SyntaxError, true)
    assertEq(e.message, "unexpected token: keyword 'case'");
}

try {
    eval("for (let debugger of ['foo', 'bar']) {}")
}
catch(e) {
    assertEq(e instanceof SyntaxError, true)
    assertEq(e.message, "unexpected token: keyword 'debugger'");
}

try {
    eval("for (let case in ['foo', 'bar']) {}")
}
catch(e) {
    assertEq(e instanceof SyntaxError, true)
    assertEq(e.message, "unexpected token: keyword 'case'");
}

try {
    eval("for (let debugger in ['foo', 'bar']) {}")
}
catch(e) {
    assertEq(e instanceof SyntaxError, true)
    assertEq(e.message, "unexpected token: keyword 'debugger'");
}

if (typeof reportCompare === "function")
    reportCompare(0, 0);