summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/spread-call-invalid-syntax.js
blob: c3288736d434aaa283eb0fec8b5498707b2ea41b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
load(libdir + "asserts.js");

var offenders = [
    "f(1 ... n)",
    "f(...x for (x in y))",
    "f(...)",
    "f(...,)",
    "f(... ...[])",
    "f(x, ...)",
    "f(...x, x for (x in y))",
    "f(x for (x in y), ...x)"
];
for (var sample of offenders) {
    assertThrowsInstanceOf(function() { eval(sample); }, SyntaxError);
}