Skip to content

Commit

Permalink
Avoid deprecated Call method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjrv committed Mar 2, 2018
1 parent fb096b5 commit c5269e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/nbind/v8/Callback.h
Expand Up @@ -51,11 +51,11 @@ class cbWrapper {
Nan::Null()
};

WireType result = func.Call(sizeof...(Args), argv);
Nan::MaybeLocal<v8::Value> result = Nan::Call(func, Nan::GetCurrentContext()->Global(), sizeof...(Args), argv);

if(result.IsEmpty()) throw(cbException());

return(convertFromWire<ReturnType>(result));
return(convertFromWire<ReturnType>(result.ToLocalChecked()));
}

template <typename ReturnType, typename... Args>
Expand All @@ -69,11 +69,11 @@ class cbWrapper {
Nan::Null()
};

WireType result = func.Call(target, sizeof...(Args), argv);
Nan::MaybeLocal<v8::Value> result = Nan::Call(func, target, sizeof...(Args), argv);

if(result.IsEmpty()) throw(cbException());

return(convertFromWire<ReturnType>(result));
return(convertFromWire<ReturnType>(result.ToLocalChecked()));
}

v8::Local<v8::Function> getJsFunction() const { return(func.GetFunction()); }
Expand Down

0 comments on commit c5269e5

Please sign in to comment.