1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

LibJS: Parse "with" statements :^)

This commit is contained in:
Andreas Kling 2020-11-28 15:05:57 +01:00
parent 98f2da9834
commit d617120499
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);