refactor: use canonical implementations and types directly

Remove forwarding wrappers and shadow aliases, migrate callers and verification scripts to their owners, and share one exhaustive semantic resource-bound projection.
This commit is contained in:
morluto committed 2026-10-09 23:35:19 +08:00
1 parent 3283a45d09
commit 765e809e36
119 files changed
+577 -629

No files matched your search

@@ -1,12 +1,9 @@
import { describe, expect, it } from "vitest";
import { analyzeJavaScriptSemantics } from "./javascriptSemanticAnalysis.js";
import {
semanticBinding,
semanticReferenceAt,
} from "./javascriptSemanticIr.js";
import {
programScope,
bindingById,
bindingsNamed,
onlyBinding,
topLevelBinding,
@@ -88,12 +85,12 @@ describe("JavaScript semantic analysis: structure 1", () => {
);
if (shadowReference === undefined || shadowReference.bindingId === null)
throw new Error("Missing shadow reference");
expect(semanticBinding(ir, shadowReference.bindingId)).toEqual(shadow);
expect(bindingById(ir, shadowReference.bindingId)).toEqual(shadow);
expect(
semanticReferenceAt(
ir,
shadowReference.location.start.line,
shadowReference.location.start.column,
ir.references.find(
({ location }) =>
location.start.line === shadowReference.location.start.line &&
location.start.column === shadowReference.location.start.column,
),
).toEqual(shadowReference);
});