aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 4bb9baea90..684c36a094 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -2195,8 +2195,9 @@ ExecutionEngine::Module ExecutionEngine::registerNativeModule(
QQmlRefPointer<CompiledData::CompilationUnit> cu;
if (m_qmlEngine) {
- // Make sure the type loader doesn't try to resolve the script anymore.
- cu = QQmlEnginePrivate::get(m_qmlEngine)->typeLoader.injectScript(url, unit);
+ // Make sure the type loader doesn't try to resolve the module anymore.
+ // If some other code requests that same module, we need to produce the same CU.
+ cu = QQmlEnginePrivate::get(m_qmlEngine)->typeLoader.injectModule(url, unit);
} else {
cu = QQml::makeRefPointer<CompiledData::CompilationUnit>(unit);
}