summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/AST.h
diff options
context:
space:
mode:
authormattco98 <matthewcolsson@gmail.com>2020-04-27 21:52:47 -0700
committerAndreas Kling <kling@serenityos.org>2020-04-28 20:37:21 +0200
commit104969a9f5c4eaacbdc89b548729a8edeada5fff (patch)
treebaf98659a032a9506a9713c4b39ce7c3b28882e9 /Libraries/LibJS/AST.h
parent3cc31ff3f3d96ddbac662669c50edb1be01abe3a (diff)
downloadserenity-104969a9f5c4eaacbdc89b548729a8edeada5fff.zip
LibJS: Add spreading in object literals
Supports spreading strings, arrays, and other objects within object literals.
Diffstat (limited to 'Libraries/LibJS/AST.h')
-rw-r--r--Libraries/LibJS/AST.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Libraries/LibJS/AST.h b/Libraries/LibJS/AST.h
index 395367afec..27d660f99e 100644
--- a/Libraries/LibJS/AST.h
+++ b/Libraries/LibJS/AST.h
@@ -703,6 +703,9 @@ public:
const Expression& key() const { return m_key; }
const Expression& value() const { return m_value; }
+ bool is_spread() const { return m_is_spread; }
+ void set_is_spread() { m_is_spread = true; }
+
virtual void dump(int indent) const override;
virtual Value execute(Interpreter&) const override;
@@ -711,6 +714,7 @@ private:
NonnullRefPtr<Expression> m_key;
NonnullRefPtr<Expression> m_value;
+ bool m_is_spread { false };
};
class ObjectExpression : public Expression {