| // 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 after undefined should not increase the arguments.length | |
| 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, undefined, | |
| //- body | |
| assert.sameValue(arguments.length, 2); | |
| assert.sameValue(arguments[0], 42); | |
| assert.sameValue(arguments[1], undefined); |