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

This commit is contained in:
Shelley Vohr 2019-02-19 21:46:59 +00:00 committed by GitHub
parent 0a730e61f5
commit cc5ed24e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()));