Skip to content

fix(compiler): preserve leading BOM literals - #316

Merged
ctate merged 1 commit into
mainfrom
codex/fix-leading-bom-literals
Sep 14, 2026
Merged

ctate merged 1 commit into
mainfrom
codex/fix-leading-bom-literals

Conversation

@ctate

@ctate ctate commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve leading U+FEFF in TypeScript 7 AST and checker string payloads while retaining WTF-8 lone-surrogate decoding
  • strip only a source file's leading BOM before tsgo parses it, matching TypeScript's filesystem reader
  • add adapter regressions plus C and LLVM differential coverage for strings, templates, tagged templates, property keys, and BOM detection

Fixes #243

Testing

  • pnpm --filter @scriptc/compiler build
  • pnpm test:ts7
  • pnpm exec vitest run tests/harness/differential.test.ts -t "2854-leading-bom-literals"
  • pnpm exec vitest run tests/harness/llvm-differential.test.ts -t "2854-leading-bom-literals"
  • pnpm test:sandbox (plain and sanitized lanes passed)

Co-authored-by: 2youg1 <65069696+2youg1@users.noreply.github.com>
@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Sep 14, 2026 3:21pm UTC

@ctate
ctate merged commit b74364e into main Sep 14, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A leading U+FEFF is stripped from every string literal, so "\uFEFF" compiles to the empty string

1 participant