From 8e45393d10ca649c46a82eb8c125bd38cc5b5615 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 27 Jul 2018 17:10:29 +0200 Subject: 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 --- tools/qmlcachegen/qmlcachegen.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/qmlcachegen/qmlcachegen.cpp') 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); -- cgit v1.2.3