Parents: #465, #498 Related: #728, #729, #730
Problem
A plain ordinary function whose formal list ends in a named rest parameter is still rejected as plain_rejected_parameter_prologue. Unlike defaults or destructuring parameters, a named rest parameter has no parameter expression and does not require a separate parameter Environment. The VM already owns exact activation slots, captured-frame lifetime, ordinary Array creation, and unmapped arguments-object semantics; rejecting this form keeps semantically eligible calls on the tree walker.
Scope
- Record the exact final rest-formal index and activation slot in immutable Chunk metadata.
- Bind every leading simple formal from its exact argument index, then create and populate the rest Array from the remaining arguments in specification order.
- Preserve the existing base-constructor private-brand/field initialization boundary and propagate allocation failure before body execution.
- Keep sloppy non-simple
argumentsunmapped, with poison-pillcallee; strict behavior and explicitargumentsparameters remain exact. - Preserve nested-arrow/upvalue capture, recursion, activation reuse, moving/concurrent GC, no-GIL shared-chunk execution, debugger locals, and stack traces.
- Admit top-level functions, nested closures, methods, and eligible base constructors with named rest parameters through the same verified compiler path.
Defaults, destructuring formals, direct eval, derived-constructor field ordering, and Annex B block functions remain separate explicit #465 boundaries.
No-workaround rules
- No tree-walker callback from VM entry, eager Environment allocation, source rewriting, guessed arity, aliased mapped arguments for a non-simple list, skipped Array elements, hidden rest pooling, or swallowed OOM.
- No stacks, queues, jobs, Promise, microtask, Worker lifecycle, or Map/Set iterator changes.
Acceptance
- Admission and bytecode tests prove the rest slot/index contract for functions, nested closures, methods, and eligible constructors.
- Forced tree-walker and required bytecode agree on zero/one/many extras, missing leading arguments, mutation/escape, nested-arrow capture, recursion,
length, arguments-object identity, poisoncallee, abrupt OOM, and activation reuse. - Moving-GC/no-GIL/TSan witnesses preserve escaped rest arrays and shared immutable Chunk metadata.
- Full units, focused frontend/VM, threadfuzz, and exact nonzero Test262 rest-parameter/function/method accounting pass with zero regressions.
- Conventional commits land directly on main and cross-link #465, #498, #728, #729, and #730.