Files
rust_browser/tests/external/js262/fixtures/rest-params-basic.js
Zachary D. Rowitsch 13bc6bddaa
All checks were successful
ci / fast (linux) (push) Successful in 6m27s
Add JavaScript spread/rest (...) operator support
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>
2026-02-22 11:52:56 -05:00

17 lines
271 B
JavaScript

function f(a, ...rest) {
console.log(a);
console.log(rest.length);
console.log(rest[0]);
console.log(rest[1]);
}
f(1, 2, 3);
function g(...args) {
console.log(args.length);
}
g();
g(1, 2, 3, 4);
var h = (...xs) => xs.length;
console.log(h(10, 20));