mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +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:
@@ -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...);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user