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
+1 -1
View File
@@ -692,7 +692,7 @@ template<typename T, typename... Args>
void SetGUIMessageProperty(const ScriptRequest& rq, JS::HandleObject messageObj, const std::string& propertyName, const T& propertyValue, Args const&... args)
{
JS::RootedValue scriptPropertyValue(rq.cx);
ScriptInterface::AssignOrToJSVal(rq, &scriptPropertyValue, propertyValue);
Script::ToJSVal(rq, &scriptPropertyValue, propertyValue);
JS_DefineProperty(rq.cx, messageObj, propertyName.c_str(), scriptPropertyValue, JSPROP_ENUMERATE);
SetGUIMessageProperty(rq, messageObj, args...);
}