mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibJS: Allow Unicode escape sequences in identifiers
For example, "property.br\u{64}wn" should resolve to "property.brown".
To support this behavior, this commit changes the Token class to hold
both the evaluated identifier name and a view into the original source
for the unevaluated name. There are some contexts in which identifiers
are not allowed to contain Unicode escape sequences; for example, export
statements of the form "export {} from foo.js" forbid escapes in the
identifier "from".
The test file is added to .prettierignore because prettier will replace
all escaped Unicode sequences with their unescaped value.
This commit is contained in:
committed by
Andreas Kling
parent
c5b5c779ff
commit
1259dc3623
Notes:
sideshowbarker
2024-07-18 05:28:09 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/1259dc36237 Pull-request: https://github.com/SerenityOS/serenity/pull/9499 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/davidot ✅
@@ -1,3 +1,3 @@
|
||||
Base/home/anon/Source/js
|
||||
Userland/Libraries/LibJS/Tests/eval-aliasing.js
|
||||
|
||||
Userland/Libraries/LibJS/Tests/unicode-identifier-escape.js
|
||||
|
||||
Reference in New Issue
Block a user