mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Parse line continuations in string literals properly
Newlines after line continuation were inserted into the string literals. This patch makes the parser ignore the newlines after \ and also makes it so that "use strict" containing a line continuation is not a valid "use strict".
This commit is contained in:
committed by
Andreas Kling
parent
e6505a95f1
commit
e5ddcadd3c
@@ -155,6 +155,8 @@ String Token::string_value(StringValueStatus& status) const
|
||||
case '\\':
|
||||
builder.append('\\');
|
||||
break;
|
||||
case '\n':
|
||||
break;
|
||||
case 'x': {
|
||||
if (i + 2 >= m_value.length() - offset)
|
||||
return encoding_failure(StringValueStatus::MalformedHexEscape);
|
||||
|
||||
Reference in New Issue
Block a user