mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
LibJS: Correctly handle Unicode characters in JS source text
Also recognize additional white space characters.
This commit is contained in:
parent
4d6502de42
commit
47bc72bcf6
6 changed files with 100 additions and 16 deletions
|
@ -85,8 +85,8 @@ static String escape_regexp_pattern(const RegExpObject& regexp_object)
|
|||
// FIXME: Check u flag and escape accordingly
|
||||
pattern.replace("\n", "\\n", true);
|
||||
pattern.replace("\r", "\\r", true);
|
||||
pattern.replace(LINE_SEPARATOR, "\\u2028", true);
|
||||
pattern.replace(PARAGRAPH_SEPARATOR, "\\u2029", true);
|
||||
pattern.replace(LINE_SEPARATOR_STRING, "\\u2028", true);
|
||||
pattern.replace(PARAGRAPH_SEPARATOR_STRING, "\\u2029", true);
|
||||
pattern.replace("/", "\\/", true);
|
||||
return pattern;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue