mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
LibJS: Implement (no-op) debugger statement
This commit is contained in:
committed by
Andreas Kling
parent
ea839861e5
commit
43c1fa9965
@@ -253,6 +253,8 @@ NonnullRefPtr<Statement> Parser::parse_statement()
|
||||
return parse_do_while_statement();
|
||||
case TokenType::While:
|
||||
return parse_while_statement();
|
||||
case TokenType::Debugger:
|
||||
return parse_debugger_statement();
|
||||
default:
|
||||
if (match_expression()) {
|
||||
auto expr = parse_expression(0);
|
||||
@@ -1044,6 +1046,13 @@ NonnullRefPtr<ForStatement> Parser::parse_for_statement()
|
||||
return create_ast_node<ForStatement>(move(init), move(test), move(update), move(body));
|
||||
}
|
||||
|
||||
NonnullRefPtr<DebuggerStatement> Parser::parse_debugger_statement()
|
||||
{
|
||||
consume(TokenType::Debugger);
|
||||
consume_or_insert_semicolon();
|
||||
return create_ast_node<DebuggerStatement>();
|
||||
}
|
||||
|
||||
bool Parser::match(TokenType type) const
|
||||
{
|
||||
return m_parser_state.m_current_token.type() == type;
|
||||
@@ -1156,7 +1165,8 @@ bool Parser::match_statement() const
|
||||
|| type == TokenType::Switch
|
||||
|| type == TokenType::Break
|
||||
|| type == TokenType::Continue
|
||||
|| type == TokenType::Var;
|
||||
|| type == TokenType::Var
|
||||
|| type == TokenType::Debugger;
|
||||
}
|
||||
|
||||
bool Parser::match_identifier_name() const
|
||||
|
||||
Reference in New Issue
Block a user