Repository navigation
Non-BMP string literals on Linux; readonly parameter properties (TSLANG 28) - #787
Merged
Merged
Conversation
The Performance table still gave the 2026-10-21 numbers (gc 1298 ms, 26x slower than C++). Since then @value, parameters captured by copy, direct calls and tagless null took the tslang builds to 70-110 ms, 1.3-2.0x of idiomatic Rust; the table now gives those, as tslang/benchmarks/raytrace/README.md does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The parser holds a source as UTF-16 units (stows reads it with
codecvt_utf8_utf16), so a character outside the BMP is a surrogate
pair. On Linux wchar_t has 32 bits, and llvm::convertWideToUTF8 read
the wide string as UTF-32, where a surrogate is invalid: the conversion
failed and a literal such as "😀" came out as "". It broke DefaultLib's
string_fromCharCode.ts on every Linux runner of the alpha118 release.
convertWideToUTF8 / convertUTF8toWide now convert UTF-16 there too;
Windows keeps its code.
The scanner's UTF16Encoding put a code point past U+FFFF in a single
wchar_t, so "\u{1F600}" was U+F600 on Windows. It is a surrogate pair
now, as the ES spec says.
00string_non_bmp.ts covers literals, templates and both escapes.
ctest: Windows 6689/6689, Linux (WSL) 6661/6661; DefaultLib main
(f5d8edb) on Linux passes rc/none/own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TypeScript makes a parameter property of a constructor parameter with public, private, protected or readonly; tslang only of the first three, so `constructor(readonly width: int)` left `t.width` unresolved. readonly alone now makes a public parameter property, in both the field list and the generated `this.x = x` assignment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three commits:
wchar_t)convertWideToUTF8read it as UTF-32, failed, and"😀"came out as""(broke DefaultLib'sstring_fromCharCode.tson every Linux runner of alpha118). The conversions now use UTF-16 there; Windows unchanged. The scanner also put"\u{1F600}"in a single unit (U+F600 on Windows); it is a surrogate pair now. Test00string_non_bmp.ts.readonlyconstructor parameter is a parameter property (TSLANG 28).constructor(readonly width: int)made no field, sot.widthdidn't resolve.readonlyalone now makes a public parameter property, as in TypeScript (field list and the generatedthis.x = x). Test00tslang_issue_28.ts, JIT + compiled under gc/rc/none/own.Testing
ctest -C Release: 6697/6697 passed (with the issue 28 fix).🤖 Generated with Claude Code