mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 14:24:43 +00:00
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. Follows34b1920e7band2bae30c454Differential Revision: https://code.wildfiregames.com/D3953 This was SVN commit r25428.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user