Debian Codegraph @

js/src/tests/test262/language/rest-parameters/arrow-function.js

raw
1 // Copyright (C) 2014 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 es6id: 14.1
5 description: >
6 arrow functions
7 includes: [compareArray.js]
8 ---*/
9 var fn = (a, b, ...c) => c;
10
11 assert.compareArray(fn(), []);
12 assert.compareArray(fn(1, 2), []);
13 assert.compareArray(fn(1, 2, 3), [3]);
14 assert.compareArray(fn(1, 2, 3, 4), [3, 4]);
15 assert.compareArray(fn(1, 2, 3, 4, 5), [3, 4, 5]);
16 assert.compareArray(((...args) => args)(), []);
17 assert.compareArray(((...args) => args)(1,2,3), [1,2,3]);
18
19 reportCompare(0, 0);