Skip to content

fix(native-preview): preserve lone surrogate string literals#3518

Open
TorinAsakura wants to merge 1 commit intomicrosoft:mainfrom
TorinAsakura:fix/wtf8-surrogate-literals
Open

fix(native-preview): preserve lone surrogate string literals#3518
TorinAsakura wants to merge 1 commit intomicrosoft:mainfrom
TorinAsakura:fix/wtf8-surrogate-literals

Conversation

@TorinAsakura
Copy link
Copy Markdown

@TorinAsakura TorinAsakura commented Apr 23, 2026

Fixes #1701

Summary

  • Encode JS string literal text with WTF-8 when it contains lone UTF-16 surrogate escapes
  • Decode WTF-8 string data in native-preview APIs and msgpack strings
  • Bump the binary AST protocol version from 5 to 6
  • Add Go and native-preview regression coverage for surrogate pairs and lone high/low surrogates

Tests

  • npm run -w @typescript/native-preview build
  • npm run build
  • npm run -w @typescript/native-preview test:only
  • go test ./...

@TorinAsakura TorinAsakura force-pushed the fix/wtf8-surrogate-literals branch from d573d96 to 5168a98 Compare April 23, 2026 02:27
@TorinAsakura TorinAsakura changed the title Preserve lone surrogates in native preview string literals Fix native preview lone surrogate string literals Apr 23, 2026
@TorinAsakura TorinAsakura changed the title Fix native preview lone surrogate string literals fix(native-preview): preserve lone surrogate string literals Apr 23, 2026
@TorinAsakura TorinAsakura force-pushed the fix/wtf8-surrogate-literals branch from 5168a98 to fcce776 Compare April 23, 2026 02:29
@TorinAsakura
Copy link
Copy Markdown
Author

@TorinAsakura please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

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.

surrogate pair and lone surrogate support in stringLiteral

1 participant