mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +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
Notes:
sideshowbarker
2024-07-18 05:36:12 +09:00
Author: https://github.com/davidot
Commit: 47bc72bcf6
Pull-request: https://github.com/SerenityOS/serenity/pull/9085
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/trflynn89
6 changed files with 100 additions and 16 deletions
|
@ -130,7 +130,7 @@ String Token::string_value(StringValueStatus& status) const
|
|||
continue;
|
||||
}
|
||||
// Line continuation
|
||||
if (lexer.next_is(LINE_SEPARATOR) || lexer.next_is(PARAGRAPH_SEPARATOR)) {
|
||||
if (lexer.next_is(LINE_SEPARATOR_STRING) || lexer.next_is(PARAGRAPH_SEPARATOR_STRING)) {
|
||||
lexer.ignore(3);
|
||||
continue;
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ bool Token::is_identifier_name() const
|
|||
|
||||
bool Token::trivia_contains_line_terminator() const
|
||||
{
|
||||
return m_trivia.contains('\n') || m_trivia.contains('\r') || m_trivia.contains(LINE_SEPARATOR) || m_trivia.contains(PARAGRAPH_SEPARATOR);
|
||||
return m_trivia.contains('\n') || m_trivia.contains('\r') || m_trivia.contains(LINE_SEPARATOR_STRING) || m_trivia.contains(PARAGRAPH_SEPARATOR_STRING);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue