chore: properly template the Then promise helper (#17058)

This commit is contained in:
trop[bot]
2019-02-25 08:51:33 +00:00
committed by Shelley Vohr
parent f3f1f6b712
commit 5c68870ad7

View File

@@ -47,7 +47,8 @@ class Promise : public base::RefCounted<Promise> {
return GetInner()->Reject(GetContext(), v8::Undefined(isolate()));
}
v8::MaybeLocal<v8::Promise> Then(base::Closure cb) {
template <typename ReturnType, typename... ArgTypes>
v8::MaybeLocal<v8::Promise> Then(base::Callback<ReturnType(ArgTypes...)> cb) {
v8::HandleScope handle_scope(isolate());
v8::Context::Scope context_scope(
v8::Local<v8::Context>::New(isolate(), GetContext()));