summaryrefslogtreecommitdiff
path: root/src/function-forms/dflt-params-trailing-comma.case
blob: 7915023e6c0740407d87538f37a151105f0c61e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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: A trailing comma should not increase the respective length, using default parameters
template: default
info: |
    Trailing comma in the parameters list

    14.1 Function Definitions

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

//- params
a, b = 39,
//- args
42, undefined, 1
//- body
assert.sameValue(a, 42);
assert.sameValue(b, 39);
//- teardown
assert.sameValue(ref.length, 1, 'length is properly set');