LibJS: Disallow 'with' statement in strict mode

This commit is contained in:
Linus Groh 2020-11-28 19:17:33 +00:00 committed by Andreas Kling
commit 3ac7fb9f6c
Notes: sideshowbarker 2024-07-19 01:12:50 +09:00
2 changed files with 6 additions and 0 deletions

View file

@ -328,6 +328,8 @@ NonnullRefPtr<Statement> Parser::parse_statement()
case TokenType::While:
return parse_while_statement();
case TokenType::With:
if (m_parser_state.m_strict_mode)
syntax_error("'with' statement not allowed in strict mode");
return parse_with_statement();
case TokenType::Debugger:
return parse_debugger_statement();