This commit is contained in:
DavidXanatos 2023-07-08 12:16:32 +02:00
parent d7c198ccad
commit f14812174d
5 changed files with 20 additions and 4 deletions

View File

@ -98,7 +98,11 @@ QV4::ReturnedValue method_invoke(const QV4::FunctionObject *b, const QV4::Value
if (!Script.isEmpty()) {
QJSValue ret = pJSEngine->evaluateScript(Script, Name + ".js");
if (ret.isError()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
pJSEngine->throwError(ret.toString());
#else
pJSEngine->throwError(ret);
#endif
return QV4::Encode::undefined();
} else {
QV4::ScopedValue rv(scope, scope.engine->fromVariant(ret.toVariant()));
@ -451,4 +455,4 @@ void CWizardEngine::OpenOptions(const QString& box, const QString& page)
});
//theGUI->SafeExec(pOptionsWnd);
pOptionsWnd->showTab(page);
}
}

View File

@ -130,7 +130,11 @@ QV4::ReturnedValue evalCall(const QV4::FunctionObject* b, const QV4::Value* v, c
QMutexLocker locker(&g_engineMutex);
QJSValue ret = g_engineMap.value(v4)->evaluateScript(scode->toQStringNoThrow(), "eval code");
if (ret.isError()) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
v4->throwError(ret.toString());
#else
v4->throwError(QJSValuePrivate::asReturnedValue(&ret));
#endif
return QV4::Encode::undefined();
} else {
QV4::ScopedValue rv(scope, scope.engine->fromVariant(ret.toVariant()));
@ -141,4 +145,4 @@ QV4::ReturnedValue evalCall(const QV4::FunctionObject* b, const QV4::Value* v, c
}
return rv->asReturnedValue();
}
}
}

View File

@ -293,6 +293,7 @@
<ClCompile Include="Engine\IniObject.cpp" />
<ClCompile Include="Engine\JSEngineExt.cpp" />
<ClCompile Include="Engine\SbieObject.cpp" />
<ClCompile Include="Engine\ScriptManager.cpp" />
<ClCompile Include="Engine\SysObject.cpp" />
<ClCompile Include="Helpers\FindTool.cpp" />
<ClCompile Include="Helpers\FullScreen.cpp" />
@ -469,6 +470,7 @@
<QtMoc Include="Engine\SysObject.h" />
<QtMoc Include="Engine\WizardObject.h" />
<QtMoc Include="Engine\JSEngineExt.h" />
<QtMoc Include="Engine\ScriptManager.h" />
<ClInclude Include="Engine\V4ScriptDebuggerApi.h" />
<ClInclude Include="Helpers\FindTool.h" />
<ClInclude Include="Helpers\FullScreen.h" />

View File

@ -219,6 +219,9 @@
<ClCompile Include="..\..\SandboxieTools\Common\verify.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Engine\ScriptManager.cpp">
<Filter>Engine</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
@ -355,6 +358,9 @@
<QtMoc Include="AddonManager.h">
<Filter>SandMan</Filter>
</QtMoc>
<QtMoc Include="Engine\ScriptManager.h">
<Filter>Engine</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<QtRcc Include="Resources\SandMan.qrc">

View File

@ -78,7 +78,7 @@ void CBoxAssistant::TryFix(quint32 MsgCode, const QStringList& MsgData, const QS
m_Params["sbieMsg"] = theGUI->FormatSbieMessage(MsgCode, MsgData, ProcessName);
m_Params["docLink"] = theGUI->MakeSbieMsgLink(MsgCode, MsgData, ProcessName);
m_Params["msgCode"] = MsgCode & 0xFFFF;
m_Params["msgData"] = MsgData.mid(1);
m_Params["msgData"] = QStringList(MsgData.mid(1));
m_Params["processName"] = (!ProcessName.isEmpty() && ProcessName.left(4) != "PID:") ? ProcessName : QString();
m_Params["boxName"] = BoxName;
setStartId(Page_Run);
@ -1066,4 +1066,4 @@ CCompletePage::CCompletePage(QWidget *parent)
void CCompletePage::initializePage()
{
//wizard()->button(QWizard::CancelButton)->setEnabled(false);
}
}