aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-27 17:10:29 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-31 07:28:03 +0000
commit8e45393d10ca649c46a82eb8c125bd38cc5b5615 (patch)
treee63fdc8496060347e24cf4b1ed88f530227b5027 /tools
parente56eeee9902ffc341506040e637654b2b0451209 (diff)
Fix import of precompiled .js files
Loading those must not fail the file relocation test, so set the source file names to empty, as we also do for .qml files. Also added tests for all the scenarios: no embedded file paths for AOT files but absolute paths for run-time created cache files. Change-Id: I3fc92e89cfd0da512afeac22bd0da3e915ec46ea Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index b9a8763c97..34814af17c 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -317,6 +317,10 @@ static bool compileJSFile(const QString &inputFileName, const QString &inputFile
return false;
}
+ // Precompiled files are relocatable and the final location will be set when loading.
+ irDocument.jsModule.fileName.clear();
+ irDocument.jsModule.finalUrl.clear();
+
QmlIR::QmlUnitGenerator generator;
irDocument.javaScriptCompilationUnit = v4CodeGen.generateCompilationUnit(/*generate unit*/false);