diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-09 21:28:31 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-09 21:49:20 +0100 |
commit | 26165cd92a1e934cceea4c76323974dd5de44327 (patch) | |
tree | 5daae1983d5685da6d4808ac337baee01923783a /Libraries/LibJS/AST.h | |
parent | 15d8b9c6714f5153608d46d0454ce468a39e9ec0 (diff) | |
download | serenity-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.h | 11 |
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"; } +}; + } |