diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/scriptengine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libs/installer/scriptengine.cpp b/src/libs/installer/scriptengine.cpp index d46805ade..9908ce29d 100644 --- a/src/libs/installer/scriptengine.cpp +++ b/src/libs/installer/scriptengine.cpp @@ -252,14 +252,14 @@ QScriptValue ScriptEngine::loadInConext(const QString &context, const QString &f // Create a closure. Put the content in the first line to keep line number order in case of an // exception. Script content will be added as the last argument to the command to prevent wrong // replacements of %1, %2 or %3 inside the javascript code. - QString scriptContent = QString::fromLatin1( - "(function() {" - " %1 %3 ;" - " if (typeof %2 != \"undefined\")" - " return new %2;" + const QString scriptContent = QLatin1String("(function() {") + + scriptInjection + QString::fromUtf8(file.readAll()) + + QString::fromLatin1(";" + " if (typeof %1 != \"undefined\")" + " return new %1;" " else" " throw \"Missing Component constructor. Please check your script.\";" - "})();").arg(scriptInjection, context, QLatin1String(file.readAll())); + "})();").arg(context); QScriptValue scriptContext = evaluate(scriptContent, fileName); if (hasUncaughtException()) { |