diff options
author | davidot <david.tuin@gmail.com> | 2021-08-14 17:07:47 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-16 23:20:04 +0100 |
commit | 47bc72bcf6f2fae3dc0938b96d8c7890b1005ead (patch) | |
tree | 61e9fe09d1cb3a012616e7744e15c6d7491c4ee6 /Userland/Libraries/LibJS/Parser.h | |
parent | 4d6502de423bdf7a278d67fa2ebb515fd834ce41 (diff) | |
download | serenity-47bc72bcf6f2fae3dc0938b96d8c7890b1005ead.zip |
LibJS: Correctly handle Unicode characters in JS source text
Also recognize additional white space characters.
Diffstat (limited to 'Userland/Libraries/LibJS/Parser.h')
-rw-r--r-- | Userland/Libraries/LibJS/Parser.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Parser.h b/Userland/Libraries/LibJS/Parser.h index eaf9df0a94..6597072736 100644 --- a/Userland/Libraries/LibJS/Parser.h +++ b/Userland/Libraries/LibJS/Parser.h @@ -120,8 +120,8 @@ public: String source_string { source }; source_string.replace("\r\n", "\n"); source_string.replace("\r", "\n"); - source_string.replace(LINE_SEPARATOR, "\n"); - source_string.replace(PARAGRAPH_SEPARATOR, "\n"); + source_string.replace(LINE_SEPARATOR_STRING, "\n"); + source_string.replace(PARAGRAPH_SEPARATOR_STRING, "\n"); StringBuilder builder; builder.append(source_string.split_view('\n', true)[position.value().line - 1]); builder.append('\n'); |