Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/scriptinterface/NativeWrapperDecls.h
Show All 37 Lines | |||||
// a bit. SpiderMonkey will throw a JS exception and abort the execution of the current function when | // a bit. SpiderMonkey will throw a JS exception and abort the execution of the current function when | ||||
// we return false here (without printing a callstack or additional detail telling that an argument | // we return false here (without printing a callstack or additional detail telling that an argument | ||||
// conversion failed). So we have two TODOs here: | // conversion failed). So we have two TODOs here: | ||||
// 1. On the conceptual side: How to consistently work with optional parameters (or drop them completely?) | // 1. On the conceptual side: How to consistently work with optional parameters (or drop them completely?) | ||||
// 2. On the technical side: Improve error handling, find a better way to ensure parameters are initialized | // 2. On the technical side: Improve error handling, find a better way to ensure parameters are initialized | ||||
#define CONVERT_ARG(z, i, data) \ | #define CONVERT_ARG(z, i, data) \ | ||||
bool typeConvRet##i; \ | bool typeConvRet##i; \ | ||||
T##i a##i = ScriptInterface::AssignOrFromJSVal<T##i>( \ | T##i a##i = ScriptInterface::AssignOrFromJSVal<T##i>( \ | ||||
cx, \ | rq, \ | ||||
i < args.length() ? args[i] : JS::UndefinedHandleValue, \ | i < args.length() ? args[i] : JS::UndefinedHandleValue, \ | ||||
typeConvRet##i); \ | typeConvRet##i); \ | ||||
if (!typeConvRet##i) return false; | if (!typeConvRet##i) return false; | ||||
// List-generating macros, named roughly after their first list item | // List-generating macros, named roughly after their first list item | ||||
#define TYPENAME_T0_HEAD(z, i) BOOST_PP_REPEAT_##z (i, NUMBERED_LIST_HEAD, typename T) // "typename T0, typename T1, " | #define TYPENAME_T0_HEAD(z, i) BOOST_PP_REPEAT_##z (i, NUMBERED_LIST_HEAD, typename T) // "typename T0, typename T1, " | ||||
#define T0(z, i) BOOST_PP_REPEAT_##z (i, NUMBERED_LIST_BALANCED, T) // "T0, T1" | #define T0(z, i) BOOST_PP_REPEAT_##z (i, NUMBERED_LIST_BALANCED, T) // "T0, T1" | ||||
#define T0_MAYBE_REF(z, i) BOOST_PP_REPEAT_##z (i, NUMBERED_LIST_BALANCED_MAYBE_REF, T) // "const T0&, T1" | #define T0_MAYBE_REF(z, i) BOOST_PP_REPEAT_##z (i, NUMBERED_LIST_BALANCED_MAYBE_REF, T) // "const T0&, T1" | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator