All checks were successful
ci / fast (linux) (push) Successful in 6m27s
Implement rest parameters, spread in calls/arrays/objects/new/super, covering tokenizer (DotDotDot), AST (Expr::Spread, ObjectPropertyKind, rest_param fields), parser, and interpreter with shared spread_iterable helper. Includes 69 new tests (29 parser + 40 interpreter) and 6 JS262 conformance fixtures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 lines
238 B
JavaScript
15 lines
238 B
JavaScript
function sum(a, b, c) {
|
|
return a + b + c;
|
|
}
|
|
|
|
console.log(sum(...[1, 2, 3]));
|
|
console.log(sum(0, ...[1, 2]));
|
|
|
|
function first(a, b, c, d) {
|
|
console.log(a);
|
|
console.log(d);
|
|
}
|
|
first(10, ...[20, 30], 40);
|
|
|
|
console.log(...[1, 2]);
|