summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/AST.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-09 21:28:31 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-09 21:49:20 +0100
commit26165cd92a1e934cceea4c76323974dd5de44327 (patch)
tree5daae1983d5685da6d4808ac337baee01923783a /Libraries/LibJS/AST.h
parent15d8b9c6714f5153608d46d0454ce468a39e9ec0 (diff)
downloadserenity-26165cd92a1e934cceea4c76323974dd5de44327.zip
LibJS: Add a very simple ObjectExpression for "var x = {}"
This allows us to allocate an empty new Object on the GC heap.
Diffstat (limited to 'Libraries/LibJS/AST.h')
-rw-r--r--Libraries/LibJS/AST.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Libraries/LibJS/AST.h b/Libraries/LibJS/AST.h
index 9e51124a30..70f388944c 100644
--- a/Libraries/LibJS/AST.h
+++ b/Libraries/LibJS/AST.h
@@ -352,4 +352,15 @@ private:
OwnPtr<ASTNode> m_initializer;
};
+class ObjectExpression : public Expression {
+public:
+ ObjectExpression() {}
+
+ virtual Value execute(Interpreter&) const override;
+ virtual void dump(int indent) const override;
+
+private:
+ virtual const char* class_name() const override { return "ObjectExpression"; }
+};
+
}