1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 12:17:35 +00:00

LibJS: Add a very simple ObjectExpression for "var x = {}"

This allows us to allocate an empty new Object on the GC heap.
This commit is contained in:
Andreas Kling 2020-03-09 21:28:31 +01:00
parent 15d8b9c671
commit 26165cd92a
2 changed files with 21 additions and 0 deletions

View file

@ -458,4 +458,14 @@ void VariableDeclaration::dump(int indent) const
m_initializer->dump(indent + 1);
}
void ObjectExpression::dump(int indent) const
{
ASTNode::dump(indent);
}
Value ObjectExpression::execute(Interpreter& interpreter) const
{
return Value(interpreter.heap().allocate<Object>());
}
}