summaryrefslogtreecommitdiff
path: root/src/function-forms/rest-params-trailing-comma-early-error.case
blob: 6f285b52d65c64410b2e01346bdf9e11cfe629a4 (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
// Copyright (C) 2016 Jeff Morrison. All rights reserved.
// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: It's a syntax error if a FunctionRestParameter is followed by a trailing comma
template: syntax
negative:
  phase: parse
  type: SyntaxError
info: |
    Trailing comma in the parameters list

    14.1 Function Definitions

    FormalParameters[Yield, Await] :
        [empty]
        FunctionRestParameter[?Yield, ?Await]
        FormalParameterList[?Yield, ?Await]
        FormalParameterList[?Yield, ?Await] ,
        FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
---*/

//- setup
throw "Test262: This statement should not be evaluated.";
//- params
...a,