LibJS: Parse "with" statements :^)

This commit is contained in:
Andreas Kling 2020-11-28 15:05:57 +01:00
commit d617120499
Notes: sideshowbarker 2024-07-19 01:13:07 +09:00
4 changed files with 55 additions and 0 deletions

View file

@ -255,6 +255,11 @@ Value IfStatement::execute(Interpreter& interpreter, GlobalObject& global_object
return js_undefined();
}
Value WithStatement::execute(Interpreter&, GlobalObject&) const
{
ASSERT_NOT_REACHED();
}
Value WhileStatement::execute(Interpreter& interpreter, GlobalObject& global_object) const
{
Value last_value = js_undefined();
@ -1142,6 +1147,18 @@ void WhileStatement::dump(int indent) const
body().dump(indent + 1);
}
void WithStatement::dump(int indent) const
{
ASTNode::dump(indent);
print_indent(indent + 1);
printf("Object\n");
object().dump(indent + 2);
print_indent(indent + 1);
printf("Body\n");
body().dump(indent + 2);
}
void DoWhileStatement::dump(int indent) const
{
ASTNode::dump(indent);