Repository navigation
fix(javascript): follow actual receivers in nested intrinsic calls - #1912
Conversation
Consume arguments per generic function invocation rather than property-chain depth. Preserve the callable receiver through call/apply, Reflect.apply and bound invocation. Cover nested mutations and fresh targets through source analysis and inert production CLI/MCP fixtures. Fixes #1909. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The receiver fix passes 488 focused tests, including production CLI/stdio MCP regressions. The public T3 boot/main source subset retains four windows and both unresolved preload expressions, with zero parse failures. The sole eventual CI test failure was the separate static Wasm/Harmony wording audit; #1917 is merged with all four shards and CI required passing, fixing that omission. Verification covers Linux static workflows, without target runtime or GUI provider execution. |
Summary
Nested
Function.prototype.call.call.call(...)consumes an extra argument layer and misses a visibleObject.createoverwrite. REA then attributes the helper-derived constructor to Electron. Follow the actual callable receiver at each generic invocation, preserving bound arguments and the original bound receiver. Fixes #1909; follow-up to #1857.Problem and expected behavior
A property's depth does not define how many calls occurred. Retain the actual function receiver and consume arguments once per invocation, so visible intrinsic replacement makes helper-derived identity unresolved while fresh local targets preserve legitimate findings.
Change and scope
Replace path-segment stripping with receiver propagation. Reuse the existing binding-factory and intrinsic-read checks. Correct detached call/apply alias fixtures to supply an actual receiver; creating an alias does not preserve JavaScript's implicit
this. Keep the fixture setup outside the CLI/MCP test body.Contract and boundary impact
Evidence and regression coverage
Pinned main
e4ac7bbfc: triple-call and bound nested-call source cases fail. Both actual CLI/stdio MCP regressions report eight windows instead of seven. An apply/apply control already passes on main.After the fix: the public fixture parses 12 files, retains all seven legitimate source anchors and preload uncertainty, and excludes ten intrinsic-poisoned modules plus the fake helper.
Source controls retain generic binding, capture timing, opaque arguments and fresh targets. Exact duplicate controls are omitted.
Remaining proof gap: arbitrary cross-call side effects are not evaluated.
Observed, derived and inferred claims remain distinguishable.
Artifact identity, source provenance and failed attempts remain preserved.
Uncertain outcomes remain visible.
Validation performed
npm run test:focused -- …— 488 tests across 11 files pass: 189 interop, 295 adjacent source/RPC and four production CLI/stdio MCP cases.npm run docs:check— six tasks pass.check:fasttypecheck/lint — pass.f80e2b7— no remaining blocker. The PR was merged while CI was running. Its eventual sole test failure was the static Wasm/Harmony wording audit; #1917 fixes that audit omission. The focused receiver regressions passed.e566055ab42d104b413575920bb62ea7f43677e014ad840fd7319d69fc83cf1f) — four windows, zero parse failures, both dynamic preload expressions preserved. This is a source subset, not full ASAR/runtime verification.Compatibility, safety, and release
Review checklist