diff options
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions.cpp | 4 | ||||
-rw-r--r-- | src/qml/parser/qqmljsast_p.h | 7 | ||||
-rw-r--r-- | tests/auto/shared/qqmljsastdumper.cpp | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index ebc9a86a16..a942b3d2c9 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -181,7 +181,9 @@ bool ScanFunctions::visit(ExportDeclaration *declaration) QString localNameForDefaultExport = QStringLiteral("*default*"); - if (declaration->exportAll) { + if (declaration->exportsAll()) { + Q_ASSERT_X(declaration->fromClause, "ScanFunctions", + "ExportDeclaration with exportAll always have a fromClause"); Compiler::ExportEntry entry; entry.moduleRequest = declaration->fromClause->moduleSpecifier.toString(); entry.importName = QStringLiteral("*"); diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index cb6d5fa3ee..6836579209 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -2957,7 +2957,6 @@ public: ExportDeclaration(FromClause *fromClause) : fromClause(fromClause) { - exportAll = true; kind = K; } @@ -2980,6 +2979,11 @@ public: kind = K; } + bool exportsAll() const + { + return fromClause && !exportClause; + } + void accept0(BaseVisitor *visitor) override; SourceLocation firstSourceLocation() const override @@ -2989,7 +2993,6 @@ public: // attributes SourceLocation exportToken; - bool exportAll = false; ExportClause *exportClause = nullptr; FromClause *fromClause = nullptr; Node *variableStatementOrDeclaration = nullptr; diff --git a/tests/auto/shared/qqmljsastdumper.cpp b/tests/auto/shared/qqmljsastdumper.cpp index 3ffb7519e3..9d4d186655 100644 --- a/tests/auto/shared/qqmljsastdumper.cpp +++ b/tests/auto/shared/qqmljsastdumper.cpp @@ -1030,7 +1030,7 @@ void AstDumper::endVisit(AST::ExportClause *) { stop("ExportClause"); } bool AstDumper::visit(AST::ExportDeclaration *el) { start(QLatin1String("ExportDeclaration exportToken=%1 exportAll=%2 exportDefault=%3") - .arg(loc(el->exportToken), boolStr(el->exportAll), boolStr(el->exportDefault))); + .arg(loc(el->exportToken), boolStr(el->exportsAll()), boolStr(el->exportDefault))); return true; } void AstDumper::endVisit(AST::ExportDeclaration *) { stop("ExportDeclaration"); } |