mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user