mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +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
2 changed files with 21 additions and 0 deletions
|
@ -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"; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue