diff options
Diffstat (limited to 'Libraries/LibJS/AST.cpp')
-rw-r--r-- | Libraries/LibJS/AST.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index 2a077f8133..95cb322e74 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -623,6 +623,11 @@ void VariableDeclaration::dump(int indent) const void ObjectExpression::dump(int indent) const { ASTNode::dump(indent); + for (String property_key : m_properties.keys()) { + print_indent(indent + 1); + printf("%s: ", property_key.characters()); + m_properties.get(property_key).value()->dump(0); + } } void ExpressionStatement::dump(int indent) const @@ -633,7 +638,12 @@ void ExpressionStatement::dump(int indent) const Value ObjectExpression::execute(Interpreter& interpreter) const { - return interpreter.heap().allocate<Object>(); + auto object = interpreter.heap().allocate<Object>(); + for (String property_key : m_properties.keys()) { + object->put(property_key, m_properties.get(property_key).value()->execute(interpreter)); + } + + return object; } void MemberExpression::dump(int indent) const |