From e9f41fdf19749dda82c8005515c9941b757750c5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 6 Aug 2018 14:19:35 +0200 Subject: Implement initial support for import namespaces The import via import * as foo from "./bar.js" allows accessing all exports via the special namespace object. This is conceptually quite similar to the existing import of .js files in QtQuick. Change-Id: Ia6d79342f0884a89dfe4dc07316570ca7789cac0 Reviewed-by: Lars Knoll --- src/qml/compiler/qv4compileddata.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/qml/compiler/qv4compileddata.cpp') diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 4e7674a67a..33e463c76a 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -469,6 +469,9 @@ const Value *CompilationUnit::resolveExportRecursively(QV4::String *exportName, (*resolveSet) << ResolveSetEntry(this, exportName); + if (exportName->toQString() == QLatin1String("*")) + return &m_module->self; + Scope scope(engine); if (auto localExport = lookupNameInExportTable(data->localExportEntryTable(), data->localExportEntryTableSize, exportName)) { -- cgit v1.2.3