Changeset View
Changeset View
Standalone View
Standalone View
source/scriptinterface/NativeWrapperDefns.h
Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | ||||||||||||||
bool ScriptInterface::CallFunction(JS::HandleValue val, const char* name, R& ret, const Ts&... params) const | bool ScriptInterface::CallFunction(JS::HandleValue val, const char* name, R& ret, const Ts&... params) const | |||||||||||||
{ | { | |||||||||||||
JSContext* cx = GetContext(); | JSContext* cx = GetContext(); | |||||||||||||
JSAutoRequest rq(cx); | JSAutoRequest rq(cx); | |||||||||||||
JS::RootedValue jsRet(cx); | JS::RootedValue jsRet(cx); | |||||||||||||
JS::AutoValueVector argv(cx); | JS::AutoValueVector argv(cx); | |||||||||||||
argv.resize(sizeof...(Ts)); | argv.resize(sizeof...(Ts)); | |||||||||||||
AssignOrToJSValHelper<0>(cx, argv, params...); | AssignOrToJSValHelper<0>(cx, argv, params...); | |||||||||||||
bool ok = CallFunction_(val, name, argv, &jsRet); | if (!CallFunction_(val, name, argv, &jsRet)) | |||||||||||||
if (!ok) | ||||||||||||||
return false; | return false; | |||||||||||||
return FromJSVal(cx, jsRet, ret); | return FromJSVal(cx, jsRet, ret); | |||||||||||||
StanUnsubmitted Done Inline Actions
Stan: | ||||||||||||||
Done Inline ActionsBreaks downstream. wraitii: Breaks downstream. | ||||||||||||||
} | } | |||||||||||||
template<typename R, typename... Ts> | template<typename R, typename... Ts> | |||||||||||||
bool ScriptInterface::CallFunction(JS::HandleValue val, const char* name, JS::Rooted<R>* ret, const Ts&... params) const | bool ScriptInterface::CallFunction(JS::HandleValue val, const char* name, JS::Rooted<R>* ret, const Ts&... params) const | |||||||||||||
{ | { | |||||||||||||
JSContext* cx = GetContext(); | JSContext* cx = GetContext(); | |||||||||||||
JSAutoRequest rq(cx); | JSAutoRequest rq(cx); | |||||||||||||
JS::MutableHandle<R> jsRet(ret); | JS::MutableHandle<R> jsRet(ret); | |||||||||||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator