Changeset View
Changeset View
Standalone View
Standalone View
source/scriptinterface/ScriptInterface.cpp
Show First 20 Lines • Show All 393 Lines • ▼ Show 20 Lines | ScriptInterface_impl::~ScriptInterface_impl() | ||||
} | } | ||||
JS_DestroyContext(m_cx); | JS_DestroyContext(m_cx); | ||||
} | } | ||||
void ScriptInterface_impl::Register(const char* name, JSNative fptr, uint nargs) const | void ScriptInterface_impl::Register(const char* name, JSNative fptr, uint nargs) const | ||||
{ | { | ||||
JSAutoRequest rq(m_cx); | JSAutoRequest rq(m_cx); | ||||
JS::RootedObject nativeScope(m_cx, m_nativeScope); | JS::RootedObject nativeScope(m_cx, m_nativeScope); | ||||
JS::RootedFunction func(m_cx, JS_DefineFunction(m_cx, nativeScope, name, fptr, nargs, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT)); | JSFunction* func = JS_DefineFunction(m_cx, nativeScope, name, fptr, nargs, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT); | ||||
ENSURE(func); | |||||
//JS::RootedFunction func(m_cx, func); | |||||
wraitii: need to revert this change | |||||
Not Done Inline ActionsStill there :p Stan: Still there :p | |||||
} | } | ||||
ScriptInterface::ScriptInterface(const char* nativeScopeName, const char* debugName, const shared_ptr<ScriptRuntime>& runtime) : | ScriptInterface::ScriptInterface(const char* nativeScopeName, const char* debugName, const shared_ptr<ScriptRuntime>& runtime) : | ||||
m(new ScriptInterface_impl(nativeScopeName, runtime)) | m(new ScriptInterface_impl(nativeScopeName, runtime)) | ||||
{ | { | ||||
// Profiler stats table isn't thread-safe, so only enable this on the main thread | // Profiler stats table isn't thread-safe, so only enable this on the main thread | ||||
if (ThreadUtil::IsMainThread()) | if (ThreadUtil::IsMainThread()) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 711 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
need to revert this change