Skip to content

Use JS-compatible Unicode casing for intrinsic string mappings#3495

Open
Andarist wants to merge 3 commits intomicrosoft:mainfrom
Andarist:fix/intrinsic-lowercase-uppercase
Open

Use JS-compatible Unicode casing for intrinsic string mappings#3495
Andarist wants to merge 3 commits intomicrosoft:mainfrom
Andarist:fix/intrinsic-lowercase-uppercase

Conversation

@Andarist
Copy link
Copy Markdown
Contributor

fixes #3489

Copy link
Copy Markdown
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very uneasy about this. Why can't we use Go's unicode ranges to do this? How can we make sure this is up to date long term?

package stringutil

//go:generate node --experimental-strip-types --no-warnings ./_scripts/generate-special-casing.mts
//go:generate gofmt -w js_case_generated.go
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be dprint

Comment on lines +8 to +9
func ToLowerJS(str string) string {
runes := []rune(str)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This perf of this is going to be abysmal; surely we can bail out for ascii?

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.

Lowercase<"İ">` differs between tsgo and tsc (Go strings.ToLower vs JS String.prototype.toLowerCase)

2 participants