-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unicode escape codes in template literal strings are improperly sanitized #484
Comments
This was referenced Mar 23, 2024
osyrisrblx
added a commit
that referenced
this issue
Jun 24, 2024
Fixes #458 and #484 ## #458: Incorrect escaping for multi-line interpolated string literals The issue was that the escape logic did not pick up Windows-style line endings properly. For this we need to also check for `\r` followed by an optional `\n`. ### Input ```ts warn(`look I am a multiline string`) ``` ### Before ```luau warn(`look I am \ a multiline string`) ``` ### After ```luau warn(`look I am\ a multiline string`) ``` ## #484: Incorrect escaping for unicode escape sequences in interpolated string literals ### Input ```ts const string_a = "\u{E000}"; const string_b = `\u{E000}`; ``` ### Before ```luau local string_a = "\u{E000}" local string_b = `\u\{E000\}` ``` ### After ```luau local string_a = "\u{E000}" local string_b = `\u{E000}` ```
osyrisrblx
added a commit
to roblox-ts/roblox-ts
that referenced
this issue
Jun 24, 2024
See roblox-ts/luau-ast#484 and [luau-ast#447](roblox-ts/luau-ast#447) Co-authored-by: Osyris <[email protected]>
Fixed by #483 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using unicode escape codes (
\u{XXXX}
) in template literal strings, the compiler escapes the curly braces when it shouldn't resulting in malformed escape sequences.Example Source Code
Expected Emit
Actual Emit
Playground Link
The text was updated successfully, but these errors were encountered: