forked from mirrors/0ad
Replace HandleWrapper and avoid repoint function
JS::Handle<T>::repoint gets removed with SpiderMonkey 38, so the existing solution has to be replaced. The new approach should also be a bit clearer. Named Return Value Optimization (NRVO) should avoid a superfluous temporary for the return value in the generic template function implementation of AssignOrFromJSVal. Refs #3708 This was SVN commit r17695.
This commit is contained in:
@@ -378,13 +378,6 @@ ScriptInterface_impl::~ScriptInterface_impl()
|
||||
JS_DestroyContext(m_cx);
|
||||
}
|
||||
|
||||
// Inside ScriptInterface.cpp directly to emphasize that it should only be used/needed internally and not from other code.
|
||||
template<> bool ScriptInterface::FromJSVal<ScriptInterface::HandleWrapper>(JSContext* UNUSED(cx), JS::HandleValue v, ScriptInterface::HandleWrapper& out)
|
||||
{
|
||||
out.set(v);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScriptInterface_impl::Register(const char* name, JSNative fptr, uint nargs)
|
||||
{
|
||||
JSAutoRequest rq(m_cx);
|
||||
|
||||
Reference in New Issue
Block a user