mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 19:06:35 +00:00
Better support for SpiderMonkey rooted types in the ScriptInterface.
* Adds additional overloads/specializations which are required when passing JS::Handle<T>/JS::MutableHandle<T> types to different functions. * Replaces GetPropertyJS with a GetProperty specialization. * Allows us to avoid the implementation of ToJSVal specializations for JS::Value and JS::HandleValue. Such conversions should only happen if there's no way around it and if you are aware of it. * Adds test to make sure that all potentially required specializations with custom implementations are instantiated. This should help prevent introducing bugs in temporarily unused code. Refs #2415 This was SVN commit r15567.
This commit is contained in:
@@ -1021,15 +1021,6 @@ bool ScriptInterface::SetGlobal_(const char* name, jsval value, bool replace)
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool ScriptInterface::GetPropertyJS(jsval obj, const char* name, JS::MutableHandleValue out)
|
||||
{
|
||||
JSContext* cx = GetContext();
|
||||
JSAutoRequest rq(cx);
|
||||
if (! GetProperty_(obj, name, out))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScriptInterface::SetProperty_(jsval obj, const char* name, jsval value, bool constant, bool enumerate)
|
||||
{
|
||||
JSAutoRequest rq(m->m_cx);
|
||||
|
||||
Reference in New Issue
Block a user