refactor: update gin_helper/function_template
(#41534)
* refactor: update gin_helper/function_template * fix: crash in Node.js Worker threads
This commit is contained in:
parent
ed28ead8ac
commit
8c427253b3
4 changed files with 271 additions and 114 deletions
|
@ -132,8 +132,9 @@ template <typename ReturnType, typename... ArgTypes>
|
|||
struct NativeFunctionInvoker<ReturnType(ArgTypes...)> {
|
||||
static void Go(base::RepeatingCallback<ReturnType(ArgTypes...)> val,
|
||||
gin::Arguments* args) {
|
||||
using Indices = typename IndicesGenerator<sizeof...(ArgTypes)>::type;
|
||||
Invoker<Indices, ArgTypes...> invoker(args, 0);
|
||||
using Indices = std::index_sequence_for<ArgTypes...>;
|
||||
Invoker<Indices, ArgTypes...> invoker(args,
|
||||
{.holder_is_first_argument = false});
|
||||
if (invoker.IsOK())
|
||||
invoker.DispatchToCallback(val);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue