diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-28 16:33:52 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-28 16:33:52 +0100 |
commit | 0593ce406b588e5bf76440bdf56eeb04bbe12ec9 (patch) | |
tree | b1c5bdaa3332acc6c6d390cf06b7b9334d2d3ef0 /Libraries/LibJS/Parser.h | |
parent | fecbef4ffe907ff160c0570b134fb87102f1194f (diff) | |
download | serenity-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.h | 1 |
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; } |