diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-01-24 15:30:16 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-02-04 16:49:20 +0100 |
| commit | c9778d2e9c41036cbd59976c51927d746bb78bcc (patch) | |
| tree | 8d707606da595851d48f178f946c481bf290ce0a /src/qml/jsruntime/qv4script.cpp | |
| parent | c350c3888ec2a24e6d4cbf1d644a0867d4eabc67 (diff) | |
QtQml: Fix assignment of fileName and URL during compilation
We need to assign them right away when creating the module. If we do it
later on, there are a lot of different code paths to cover and in fact
we were missing some.
Pick-to: 6.9 6.8
Task-number: QTBUG-133053
Change-Id: I57e381c787f504eb9bcd8c2041e41b4f1d1f8b53
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index 894426ce3b..d8f6ebbf48 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -51,7 +51,7 @@ void Script::parse() ExecutionEngine *v4 = context->engine(); Scope valueScope(v4); - QV4::Compiler::Module module(v4->debugger() != nullptr); + QV4::Compiler::Module module(sourceFile, sourceFile, v4->debugger() != nullptr); if (sourceCode.startsWith(QLatin1String("function("))) { static const int snippetLength = 70; @@ -91,7 +91,7 @@ void Script::parse() RuntimeCodegen cg(v4, &jsGenerator, strictMode); if (inheritContext) cg.setUseFastLookups(false); - cg.generateFromProgram(sourceFile, sourceFile, sourceCode, program, &module, contextType); + cg.generateFromProgram(sourceCode, program, &module, contextType); if (v4->hasException) return; @@ -136,7 +136,7 @@ Function *Script::function() QQmlRefPointer<QV4::CompiledData::CompilationUnit> Script::precompile( QV4::Compiler::Module *module, QQmlJS::Engine *jsEngine, - Compiler::JSUnitGenerator *unitGenerator, const QString &fileName, const QString &finalUrl, + Compiler::JSUnitGenerator *unitGenerator, const QString &fileName, const QString &source, QList<QQmlError> *reportedErrors, QV4::Compiler::ContextType contextType) { @@ -164,7 +164,7 @@ QQmlRefPointer<QV4::CompiledData::CompilationUnit> Script::precompile( } Codegen cg(unitGenerator, /*strict mode*/false); - cg.generateFromProgram(fileName, finalUrl, source, program, module, contextType); + cg.generateFromProgram(source, program, module, contextType); if (cg.hasError()) { if (reportedErrors) { const auto v4Error = cg.error(); |
