mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibJS: Disallow '\8' and '\9' in strict mode due to being octal escapes
This commit is contained in:
parent
c57721cf83
commit
7624c3de0e
2 changed files with 13 additions and 0 deletions
|
@ -198,6 +198,12 @@ String Token::string_value(StringValueStatus& status) const
|
|||
continue;
|
||||
}
|
||||
|
||||
if (lexer.next_is('8') || lexer.next_is('9')) {
|
||||
status = StringValueStatus::LegacyOctalEscapeSequence;
|
||||
builder.append(lexer.consume());
|
||||
continue;
|
||||
}
|
||||
|
||||
lexer.retreat();
|
||||
builder.append(lexer.consume_escaped_character('\\', "b\bf\fn\nr\rt\tv\v"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue