Repository navigation
fix(javascript): scope candidate this event receivers - #4656
Conversation
Preserve lexical receiver scopes and possible local inheritance links without asserting runtime this identity. Keep decorator evaluation outside method receiver and callable boundaries. Fixes morluto#3360 AI-assisted implementation and verification with OpenAI Codex; human PR ownership and readiness remain unfilled.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] This PR appears safe to merge; no new actionable issue was found. SummaryThis PR separates class
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Event call on this"] --> B["Find enclosing receiver"]
B --> C["Ordinary function or outer scope"]
B --> D["Class member"]
D --> E["Instance side"]
D --> F["Static side"]
E --> G["Matching local-base family"]
F --> G
C --> H["Incomplete event identity"]
G --> H
H --> I["Candidate relation and event unknown"]
Reviews (5) · Last reviewed commit: "Merge upstream main into the JavaScript ..." · Reviewed by Greptile |
Reuse the canonical expression normalizer to preserve object function receiver identity through transparent wrappers. Keep arrows, computed keys and non-transparent expressions separate. AI-assisted implementation and verification with OpenAI Codex.
|
Thank you for separating receiver scopes and retaining partial identities. Main now keys |
Retain instance/static sides and possible local-base event links on current main. Keep this identities incomplete and remove the shared callable-stack changes from the PR.
Apply the existing computed-method-key evaluation boundary before non-arrow receiver selection. Cover object method keys and bodies through semantic IR and CLI/MCP regressions.
|
@Xinglan233 thanks for the PR — this branch has merge conflicts with |
…410-windows-transport * commit '28772e67d245661b4a66ef5a09353eafda483367': (674 commits) docs: note symlink EPERM in Windows source test failures (morluto#7211) fix(javascript): scope candidate this event receivers (morluto#4656) fix(config): validate target and loader options before printing MCP registrations (morluto#9279) fix(native): honor cancellation during PE alias expansion (morluto#9063) fix(audit): preserve env shebang argument ownership (morluto#14075) feat(evtx): inventory Windows event log records offline docs(skill): replace the staged workflow with the rules it encodes (morluto#10374) fix(hopper): clarify publisher verification failures fix(analysis-view): keep PTX text pages on Unicode boundaries (morluto#15222) feat(mcp): advertise each tool's family in tools/list _meta (morluto#7154) perf(evidence): inspect retained records without building a bundle (morluto#15219) fix(process): report denied inspection as typed cleanup failures (morluto#9261) perf(mcp): complete retained Evidence without rebuilding bundles (morluto#15210) fix(agentenv): stop dry-run tarball reads on cancellation (morluto#15205) perf(png): reuse scanline storage in screenshot comparisons (morluto#15215) fix(javascript): respect Node HTTP path validation (morluto#9684) fix(windows): reject native addons with unusable delay-import tables (morluto#15216) feat(artifacts): inventory Android super image metadata (morluto#14928) fix(paths): reject dotted console device names for portability (morluto#15220) fix(analysis-view): return continuation for GPU pages at the byte limit (morluto#15206) ...
Summary
Refine class
thisevent candidates on top of main's #3360 fix. Prepared with OpenAI Codex.Problem and expected behavior
Main separates lexical receivers and keeps
thisidentities incomplete. The remaining distinctions are class instance/static sides and possible inherited links: instance and static fields must not share an event, while matching sides of possible local bases should retain candidate links.Change and scope
thisidentity incomplete. A shared unknown external base does not join classes. Member arrows inherit their receiver; computed keys, decorators and heritage use the enclosing receiver.CallableStackchanges and duplicated [Bug] Unrelated this receivers share one resolved event identity #3360 base coverage remain outside the diff.Contract and boundary impact
thisevent keys/IDs require fresh graph seeds; retained graphs remain usable.Expected effects:
Evidence and regression coverage
7681b1745and pass after applying the shared evaluation boundary (review).98422997c035bf314084b7d786628616e70bc95f, 10 of the original 11 receiver cases fail; the external-base negative case and main's 8 identity-boundary controls pass. Those 19 pass with this change.readyevents on main versus the expected 5 after this change: two inherited receiver-side families, two unrelated external-base receivers and one stable binding. Static/instance fields also retain two separate events.thisrelations remain candidates with event unknowns; stable binding relations remain resolved. CLI and MCP graphs, plus MCP text/structured results, agree.Validation performed
macOS 27.2 arm64; Node 24.22.1, npm 11.16.0; head
8f81e82d7ac956d39b9370e3924e6f73c2fe2461(tested main baseline98422997c; follow-up to7681b1745).npm run test:local -- <72 JavaScript semantic domain/application test files>— 1,804 passed.npm run test:focused -- tests/acceptance/applications/javascriptThisEmitters.test.ts tests/acceptance/applications/javascriptEventPayload.test.ts tests/acceptance/applications/javascriptTimerWritesCli.test.ts— 3 passed; runtime built.npm run check:fast, changed-fileoxfmt --threads=1 --check,git diff --check— passed.7681b1745:npm run docs:check,npm run docs:buildandnpm run verify:test-discoverypassed (2,666 test files exactly once). These unchanged checks were not rerun for this follow-up.Compatibility, safety, and release
Candidate families overapproximate receiver equality. Rebinding with
.call/.apply/.bind, general aliasing and external/cross-file inheritance remain unresolved. Full-suite, other-OS and real Hopper/Ghidra/browser lanes were not run for this static JavaScript change. No package/release metadata or target-execution capability changes.Author readiness
Human owner: @Xinglan233
Before merge
type(scope): outcome.