aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qquickworkerscript.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-04-26 11:48:04 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-02 14:20:21 +0000
commitc7fe748850383c5afcc18acf5568be0badd95c93 (patch)
tree99d5fc744b154b879496822a655859d491327224 /src/qml/types/qquickworkerscript.cpp
parent440a25388b55d465873647b3dc9f470ed68e917e (diff)
Cleanup creation code for builtin functions
Centralize the code in FunctionObject::createBuiltinFunction and setup function names and length properties there. Change-Id: I21f1d42b475070ee091d96d97387149af1dc47f2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/types/qquickworkerscript.cpp')
-rw-r--r--src/qml/types/qquickworkerscript.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index 859f647ce4..501de392e3 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -250,8 +250,7 @@ void QQuickWorkerScriptEnginePrivate::WorkerEngine::init()
QV4::ScopedFunctionObject createsendconstructor(scope, createsendscript.run());
Q_ASSERT(!scope.engine->hasException);
QV4::ScopedString name(scope, m_v4Engine->newString(QStringLiteral("sendMessage")));
- QV4::ScopedValue function(scope, QV4::FunctionObject::createBuiltinFunction(globalContext, name,
- QQuickWorkerScriptEnginePrivate::method_sendMessage));
+ QV4::ScopedValue function(scope, QV4::FunctionObject::createBuiltinFunction(m_v4Engine, name, method_sendMessage, 1));
QV4::JSCallData jsCallData(scope, 1);
jsCallData->args[0] = function;
*jsCallData->thisObject = m_v4Engine->global();