Parent: #465, #491. Found while preparing captured-binding admission under #467; follows #1086.
Executed on 5b73904e against Node and direct system JavaScriptCore: Function.arguments currently aliases live parameters and the function's own arguments object, and repeat property reads return the same object.
Examples confirmed in both reference engines:
- A nested function saves
outer.arguments, then performsa += 3. Both references retain snapshot index 0 = 4 while the live parameter becomes 7; zig-js tree/required-VM returns index 0 = 7. var one = f.arguments; a = 9; var two = f.arguments; one[0] = 22yields[false,22,9,9]without an own arguments binding. Both zig-js modes yield[true,22,22,22].- When the function has an own arguments binding, snapshots retain the original argument values even as mapped parameters change. Deleting or replacing an index with a getter must not cause the snapshot read to invoke that getter. Both references return
[4,0,9]for the accessor witness; both zig-js modes return[7,1,9]. - Missing duplicate formals expose an additional tree/VM discrepancy:
f(a,a)called with one argument preserves snapshot[1,3,null]in both references/VM while tree mode returns[1,9,null].
Scope: create a fresh detached snapshot for every active legacy property read; retain correct original/current argument sources, duplicate/missing/extra argument rules, non-simple callee poison, callee realm intrinsics, GC ownership, and OOM cleanup. Preserve the separately mapped ordinary arguments binding. Pin the JSC descriptor choice where Node differs (simple snapshot callee is enumerable in JSC). Correct existing native caller witnesses that assume mutating Function.arguments mutates the formal; the frame-preservation fix itself remains required.
Definition of done:
- Reference-confirmed snapshots/identity/mutation/getter/duplicate cases match in tree, required-VM, and native-enabled execution.
- Own mapped arguments semantics, strict/function-kind restrictions, realms, recursive active frames, and missing/extra/non-simple arguments remain exact.
- Moving-GC/OOM/no-GIL and Debug/ReleaseSafe/unsuppressed TSan gates pass with exact-root ownership.
- Exact-parent affected corpus outcomes and production build pass; small conventional fix/evidence pushed to main.