test262/src/arguments/args-trailing-comma-multiple.case
Leo Balter 07a7ac999d Add templates for trailing comma in arguments list
Also fix destination path for generated tests
And add a case for spread operator in the arguments before a trailing comma
2018-09-04 17:10:51 -04:00

30 lines
793 B
Plaintext

// 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 arguments.length, using multiple args
template: default
info: |
Trailing comma in the arguments list
Left-Hand-Side Expressions
Arguments :
( )
( ArgumentList )
( ArgumentList , )
ArgumentList :
AssignmentExpression
... AssignmentExpression
ArgumentList , AssignmentExpression
ArgumentList , ... AssignmentExpression
---*/
//- args
42, 'TC39',
//- body
assert.sameValue(arguments.length, 2);
assert.sameValue(arguments[0], 42);
assert.sameValue(arguments[1], 'TC39');