summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arguments/rest-invalid-syntax.js
blob: f91d93ea620d0b66b64d56c9b9216557d8b0c084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
load(libdir + "asserts.js");
var ieval = eval;
var offenders = [["..."], ["...rest"," x"], ["...rest", "[x]"],
                 ["...rest", "...rest2"]];
for (var arglist of offenders) {
    assertThrowsInstanceOf(function () {
        ieval("function x(" + arglist.join(", ") + ") {}");
    }, SyntaxError);
    assertThrowsInstanceOf(function () {
        Function.apply(null, arglist.concat("return 0;"));
    }, SyntaxError);
}