summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Parser.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-28 16:33:52 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-28 16:33:52 +0100
commit0593ce406b588e5bf76440bdf56eeb04bbe12ec9 (patch)
treeb1c5bdaa3332acc6c6d390cf06b7b9334d2d3ef0 /Libraries/LibJS/Parser.h
parentfecbef4ffe907ff160c0570b134fb87102f1194f (diff)
downloadserenity-0593ce406b588e5bf76440bdf56eeb04bbe12ec9.zip
LibJS: Implement basic support for the "new" keyword
NewExpression mostly piggybacks on the existing CallExpression. The big difference is that "new" creates a new Object and passes it as |this| to the callee.
Diffstat (limited to 'Libraries/LibJS/Parser.h')
-rw-r--r--Libraries/LibJS/Parser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibJS/Parser.h b/Libraries/LibJS/Parser.h
index 7cbd614b32..25bc408da4 100644
--- a/Libraries/LibJS/Parser.h
+++ b/Libraries/LibJS/Parser.h
@@ -63,6 +63,7 @@ public:
NonnullRefPtr<ArrayExpression> parse_array_expression();
NonnullRefPtr<Expression> parse_secondary_expression(NonnullRefPtr<Expression>, int min_precedence, Associativity associate = Associativity::Right);
NonnullRefPtr<CallExpression> parse_call_expression(NonnullRefPtr<Expression>);
+ NonnullRefPtr<NewExpression> parse_new_expression();
bool has_errors() const { return m_has_errors; }