Jeremy Apthorp 2019-01-09 11:17:05 -08:00
parent 7d5cd2051a
commit d01db5a656
26 changed files with 94 additions and 46 deletions

View file

@ -55,8 +55,10 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
v8::Local<v8::Context> context = holder->CreationContext();
v8::Context::Scope context_scope(context);
std::vector<v8::Local<v8::Value>> args{ConvertToV8(isolate, raw)...};
v8::Local<v8::Value> ret(holder->Call(
holder, args.size(), args.empty() ? nullptr : &args.front()));
v8::Local<v8::Value> ret(holder
->Call(context, holder, args.size(),
args.empty() ? nullptr : &args.front())
.ToLocalChecked());
return handle_scope.Escape(ret);
}
};
@ -76,7 +78,10 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
v8::Local<v8::Context> context = holder->CreationContext();
v8::Context::Scope context_scope(context);
std::vector<v8::Local<v8::Value>> args{ConvertToV8(isolate, raw)...};
holder->Call(holder, args.size(), args.empty() ? nullptr : &args.front());
holder
->Call(context, holder, args.size(),
args.empty() ? nullptr : &args.front())
.ToLocalChecked();
}
};