fix(javascript): derive loader references from lexical binding ownership

Use shared lexical bindings and recovered bundler identities for require and chunk references. Preserve uncertain writes as unresolved evidence; remove name-only loader aliases and repeated definition scans.

Reviewed-PR: #2989
Co-authored-by: Hussnain Ahmad <ha7886899@gmail.com>
This commit is contained in:
morluto
2026-10-14 16:00:20 +08:00
parent f2f83934d2
commit eef4a0bfb4
8 changed files with 509 additions and 32 deletions
@@ -46,6 +46,8 @@ export interface JavaScriptSemanticBindingState {
readonly scopeId: string;
readonly name: string;
kind: JavaScriptSemanticDefinition["kind"];
/** Source declaration form retained internally for CommonJS wrapper bindings. */
declarationKinds: Set<"var" | "let" | "const" | "using" | "await using">;
mutable: boolean;
readonly memberWrites: JavaScriptSemanticMemberEffect[];
readonly escapedPaths: JavaScriptSemanticMemberEffect[];