From 5faf2e9a693d10e1e689c42deec911083a35ddb2 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 21 Jun 2018 22:57:07 +0200 Subject: Properly distinguish between class expressions and declarations Introduce both types in the AST, and handle them properly in the code generator. Change-Id: I754ac0976de69009bdb8b203d890e4ec0ad03b30 Reviewed-by: Simon Hausmann --- src/qml/parser/qqmljsast.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/qml/parser/qqmljsast.cpp') diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp index 1c997e1de7..89ef861c85 100644 --- a/src/qml/parser/qqmljsast.cpp +++ b/src/qml/parser/qqmljsast.cpp @@ -1296,6 +1296,16 @@ void ClassExpression::accept0(Visitor *visitor) visitor->endVisit(this); } +void ClassDeclaration::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + accept(heritage, visitor); + accept(elements, visitor); + } + + visitor->endVisit(this); +} + void ClassElementList::accept0(Visitor *visitor) { if (visitor->visit(this)) { -- cgit v1.2.3