Split JS conversions from ScriptInterface.

All ToJSVal/FromJSVal definitions are put in a separate header.
Remove AssignOr[To/From]JSVal duplication.

The functions were already static so this is rather straightforward.

Follows 34b1920e7b and 2bae30c454

Differential Revision: https://code.wildfiregames.com/D3953
This was SVN commit r25428.
This commit is contained in:
wraitii
2021-05-13 09:43:33 +00:00
parent d798a2ec0e
commit 61e0aef0b4
40 changed files with 323 additions and 371 deletions
+3 -3
View File
@@ -23,7 +23,7 @@
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/ScriptRequest.h"
bool ScriptException::IsPending(const ScriptRequest& rq)
{
@@ -49,7 +49,7 @@ bool ScriptException::CatchPending(const ScriptRequest& rq)
if (!excn.isObject())
{
CStr error;
ScriptInterface::FromJSVal(rq, excn, error);
Script::FromJSVal(rq, excn, error);
LOGERROR("JavaScript error: %s", error);
return true;
}
@@ -60,7 +60,7 @@ bool ScriptException::CatchPending(const ScriptRequest& rq)
if (!report)
{
CStr error;
ScriptInterface::FromJSVal(rq, excn, error);
Script::FromJSVal(rq, excn, error);
LOGERROR("JavaScript error: %s", error);
return true;
}