mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +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:
parent
15d8b9c671
commit
26165cd92a
Notes:
sideshowbarker
2024-07-19 08:47:59 +09:00
Author: https://github.com/awesomekling
Commit: 26165cd92a
2 changed files with 21 additions and 0 deletions
|
@ -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>());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue