Provide ScriptInterface CreateObject and CreateArray functions to replace Eval calls following 7c2e9027c2, 1c0536bf08 and later.

Differential Revision: https://code.wildfiregames.com/D2080
Previous version reviewed By: Krinkle
Comments By: historic_bruno, wraitii
This was SVN commit r22528.
This commit is contained in:
elexis
2019-07-22 19:35:14 +00:00
parent 6643613b54
commit b4626359f5
23 changed files with 316 additions and 192 deletions
+7 -4
View File
@@ -398,10 +398,13 @@ JS::Value CMapGeneratorWorker::LoadMapTerrain(ScriptInterface::CxPrivate* pCxPri
}
}
JS::RootedValue returnValue(cx, JS::ObjectValue(*JS_NewPlainObject(cx)));
self->m_ScriptInterface->SetProperty(returnValue, "height", heightmap);
self->m_ScriptInterface->SetProperty(returnValue, "textureNames", textureNames);
self->m_ScriptInterface->SetProperty(returnValue, "textureIDs", textureIDs);
JS::RootedValue returnValue(cx);
self->m_ScriptInterface->CreateObject(
&returnValue,
"height", heightmap,
"textureNames", textureNames,
"textureIDs", textureIDs);
return returnValue;
}