Debian Codegraph @

js/src/tests/test262/language/rest-parameters/rest-parameters-call.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 Rest parameter and Function.prototype.call
7 ---*/
8 function af(...a) {
9 return a.length;
10 }
11
12 assert.sameValue(af.call(null), 0, "`af.call(null)` returns `0`");
13 assert.sameValue(af.call(null, 1), 1, "`af.call(null, 1)` returns `1`");
14 assert.sameValue(af.call(null, 1, 2), 2, "`af.call(null, 1, 2)` returns `2`");
15
16 reportCompare(0, 0);