mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user