summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/AST.h
diff options
context:
space:
mode:
authorJack Karamanian <karamanian.jack@gmail.com>2020-05-30 00:10:42 -0500
committerAndreas Kling <kling@serenityos.org>2020-05-30 10:33:24 +0200
commitc12125fa817bdbf423cb01e171addf9765eca417 (patch)
tree6b92b1eafa021da0979fdd5b519fd249aabd9cc6 /Libraries/LibJS/AST.h
parent5243e9974d20647c3ef3d94db224a66fdc100db5 (diff)
downloadserenity-c12125fa817bdbf423cb01e171addf9765eca417.zip
LibJS: Track whether ScriptFunctions and FunctionExpressions are arrow
functions
Diffstat (limited to 'Libraries/LibJS/AST.h')
-rw-r--r--Libraries/LibJS/AST.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Libraries/LibJS/AST.h b/Libraries/LibJS/AST.h
index 297f41884b..115a193604 100644
--- a/Libraries/LibJS/AST.h
+++ b/Libraries/LibJS/AST.h
@@ -223,8 +223,9 @@ class FunctionExpression final
public:
static bool must_have_name() { return false; }
- FunctionExpression(const FlyString& name, NonnullRefPtr<Statement> body, Vector<Parameter> parameters, i32 function_length, NonnullRefPtrVector<VariableDeclaration> variables)
+ FunctionExpression(const FlyString& name, NonnullRefPtr<Statement> body, Vector<Parameter> parameters, i32 function_length, NonnullRefPtrVector<VariableDeclaration> variables, bool is_arrow_function = false)
: FunctionNode(name, move(body), move(parameters), function_length, move(variables))
+ , m_is_arrow_function(is_arrow_function)
{
}
@@ -233,6 +234,8 @@ public:
private:
virtual const char* class_name() const override { return "FunctionExpression"; }
+
+ bool m_is_arrow_function;
};
class ErrorExpression final : public Expression {