mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 14:48:15 +00:00
LibJS: Handle "for" statements with empty initializer and updater
This commit is contained in:
@@ -126,7 +126,7 @@ Value ForStatement::execute(Interpreter& interpreter) const
|
||||
{
|
||||
RefPtr<BlockStatement> wrapper;
|
||||
|
||||
if (m_init->is_variable_declaration() && static_cast<const VariableDeclaration*>(m_init.ptr())->declaration_type() != DeclarationType::Var) {
|
||||
if (m_init && m_init->is_variable_declaration() && static_cast<const VariableDeclaration*>(m_init.ptr())->declaration_type() != DeclarationType::Var) {
|
||||
wrapper = create_ast_node<BlockStatement>();
|
||||
interpreter.enter_scope(*wrapper, {}, ScopeType::Block);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user