Skip to content

A literal starting with U+FEFF keeps it; an old runtime is named (TSLANG 34-36) - #790

Merged
ASDAlexander77 merged 1 commit into
mainfrom
string-escapes-runtime-check
Nov 8, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
string-escapes-runtime-check

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

TSLANG 34: a string literal starting with U+FEFF lost it

LLVM's convertUTF16ToUTF8String treats a leading U+FEFF as a byte order mark and skips it. It would also byte-swap a whole string starting with U+FFFE. convertWideToUTF8 (MLIRHelper.h) now calls ConvertUTF16toUTF8 directly on the units as they are, on Windows and Linux alike. "\uFEFF".length is now 3, not 0.

TSLANG 35: "\\n" read as a line feed

This does not reproduce. On this build the filed repro prints 2 6 4 2 2 3 and 92 2, as expected. The new test covers these cases anyway.

TSLANG 36: an older runtime gave a bare LNK2001 for __tslang_heap_shared

  • Before linking an --emit=dll on Windows, tslang now checks that TypeScriptAsyncRuntime.lib contains __tslang_heap_shared. If it doesn't, tslang says the runtime is older than the compiler and to point --tslang-lib-path (or TSLANG_LIB_PATH) at the runtime that came with it. I checked this against a runtime from 2026-10-31, and checked that the current runtime still links.
  • -v is now an alias for --verbose, which is no longer hidden and prints the linker's command line. So the linker's "use -v to see invocation" hint now works.

TSLANG_ISSUES.md: 34-36 are moved into the fixed summary, and the open -mm=own items 31-33 are recorded.

Tests

  • New 00string_literal_escapes.ts, in all four memory models, JIT and compiled. It fails on alpha119.
  • Windows: the full ctest passed, apart from the new test's first version, which used default-library calls that the test runner's --no-default-lib doesn't have. After rewriting it, the new tests and the ownership verifier pass. The binary changed only by a comment after the full run.
  • Linux (WSL): the new test passes in all four models, as do the existing 00string* tests.

🤖 Generated with Claude Code

…ANG 34-36)

34: LLVM's UTF-16 to UTF-8 conversion takes a leading U+FEFF for a byte order
mark and skips it (and byte-swaps a string starting with U+FFFE), so a string
literal starting with that character lost it. Literals are converted as they
are.

35 ("\\n" read as a line feed) does not reproduce; the new test covers it.

36: a runtime library older than #784 failed every --emit=dll with a bare
LNK2001 for __tslang_heap_shared. tslang checks TypeScriptAsyncRuntime.lib
first and says the runtime is older than the compiler. -v is an alias for
--verbose, so the linker's "use -v" hint works.

Also records the open -mm=own items 31-33 in TSLANG_ISSUES.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 2911ffb into main Nov 8, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the string-escapes-runtime-check branch November 8, 2026 22:57
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.

1 participant