From 6ba49b30cf1e33fb0dd6782a404ec34b7964cb59 Mon Sep 17 00:00:00 2001 From: Martin Dobrev Date: Tue, 24 Nov 2020 18:06:26 +0200 Subject: Feature/object getters (#101) * Add member access expression. * Implement property getters. * Add test for property getters. * Add test for property setter. * Implement while and do-while Signed-off-by: Martin Dobrev * Add implement byte code generation for break/continue in for/while. --- JSImpl/src/ASTInterpreter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'JSImpl/src/ASTInterpreter.cpp') diff --git a/JSImpl/src/ASTInterpreter.cpp b/JSImpl/src/ASTInterpreter.cpp index f550da9..f56706a 100644 --- a/JSImpl/src/ASTInterpreter.cpp +++ b/JSImpl/src/ASTInterpreter.cpp @@ -240,6 +240,7 @@ public: } virtual void Visit(IdentifierExpression* e) override { m_LValue = m_Interpreter->ModifyVariable(e->GetName()); } + virtual void Visit(Call* e) override { e->GetObjectOrCall()->Accept(*this); } ASTInterpreter* m_Interpreter; ASTInterpreter::ValuePtr m_LValue; @@ -565,9 +566,13 @@ void ASTInterpreter::Visit(EmptyExpression* e) { NOT_IMPLEMENTED; } -void ASTInterpreter::Visit(CallExpression* e) +void ASTInterpreter::Visit(Call* e) { - NOT_IMPLEMENTED; + e->GetObjectOrCall()->Accept(*this); + if (e->GetMember()) + { + e->GetMember()->Accept(*this); + } } void ASTInterpreter::Print(Printer& p) -- cgit v1.3.1-23-gd82d