-
Notifications
You must be signed in to change notification settings - Fork 720
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Steps to reproduce
for following code tsgo and typescript generate differents token text
"🦀\ud7ff\ud800\ud801\uD83E\uDD80"
It seems tsgo using go string to store codePoint(from JS string),
typescript-go/internal/ast/ast.go
Line 5813 in 0216862
func (f *NodeFactory) NewStringLiteral(text string) *Node { |
but JS string is not strict UTF16 string which may contain lone surrogate while go string will convert lone surrogate to U+FFFD which is a lossy conversion and lose the origin info
Behavior with [email protected]
🦀\ud7ff\ud800\ud801\uD83E\uDD80
https://ts-ast-viewer.com/#code/ESPg3AG7A6CuAmDsAzB0YA4AM6UYIzQCKoDMAogYesEA
Behavior with tsgo
🦀����
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed