Files
scriptc/tests/fixtures/self-hosting/source-locations.ts
Chris Tate 4070ef701c fix(compiler): unblock self-hosting analysis and tuple construction (#488)
* fix(compiler): unblock self-hosting analysis and tuple construction

- Bound type diagnostics to handle deeply nested and shared compiler types.
- Compile fixed tuple spreads and preserve const tuple inference under satisfies.
- Add native compiler-component and differential regression coverage.

* fix(tests): record tuple spread frontend parity baseline

- Record module order and preflight diagnostics for the new tuple spread regression fixture.
2026-09-27 10:29:10 -05:00

16 lines
706 B
TypeScript

import { SourceLocations } from "../../../packages/compiler/src/backend/source-locations.js";
// Exercise the real compiler module, including every offset around each
// newline form, astral characters, empty files, and failed lookups.
const text = "one\r\ntwo\rthree\nfour\u2028five\u2029😀six\n";
const sources = new Map<string, string>();
sources.set("main.ts", text);
sources.set("empty.ts", "");
sources.set("other.ts", "other");
const locations = new SourceLocations(sources);
for (const file of ["main.ts", "empty.ts", "other.ts", "missing.ts"]) {
for (let start = -1; start <= text.length + 1; start++) {
console.log(JSON.stringify(locations.position({ file, start, end: start })));
}
}