summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Parser.h
diff options
context:
space:
mode:
authordavidot <david.tuin@gmail.com>2021-08-14 17:07:47 +0200
committerLinus Groh <mail@linusgroh.de>2021-08-16 23:20:04 +0100
commit47bc72bcf6f2fae3dc0938b96d8c7890b1005ead (patch)
tree61e9fe09d1cb3a012616e7744e15c6d7491c4ee6 /Userland/Libraries/LibJS/Parser.h
parent4d6502de423bdf7a278d67fa2ebb515fd834ce41 (diff)
downloadserenity-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.h4
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');