diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-20 11:23:01 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-21 06:33:11 +0000 |
commit | 26e9c07650474a23817487e768bbebbb87bd78e4 (patch) | |
tree | a287f36b018be08ad1c75d0d41cfef0a305c0d52 /src/qml/jsruntime/qv4include.cpp | |
parent | 3a7bd721edad972dd0691ff814b3417b4b5228a0 (diff) |
Clean up QML worker scripts part 2
Now that we have one JS engine per worker script, we can get rid of the
per-script QML context and let the script simply run in the global
object, which is now also mutable.
Change-Id: I36d8616b85b2c0ff3a356ee7be9d242c3da624cf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4include.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4include.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index d0d66c9b9a..e3e16fa070 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -207,7 +207,7 @@ QV4::ReturnedValue QV4Include::method_include(const QV4::FunctionObject *b, cons QQmlContextData *context = scope.engine->callingQmlContext(); - if (!context || !context->isJSContext) + if ((!context || !context->isJSContext) && scope.engine->qmlEngine()) RETURN_RESULT(scope.engine->throwError(QString::fromUtf8("Qt.include(): Can only be called from JavaScript files"))); QV4::ScopedValue callbackFunction(scope, QV4::Primitive::undefinedValue()); |