From 3a5b3a4b4575000b4269bbed2d029d85973d8cc6 Mon Sep 17 00:00:00 2001 From: John French Date: Tue, 2 Oct 2018 09:20:11 +0900 Subject: [PATCH] src: use MakeCallback() -> Call() in AsyncWorker Change `AsyncWorker::OnOK()` and `AsyncWorker::OnError()` callbacks to **NOT** use `MakeCallback()`. An ordinary function call (`_callback::Call()`) is now correct. PR-URL: https://github.com/nodejs/node-addon-api/pull/361 Refs: https://nodejs.org/api/n-api.html#n_api_napi_make_callback Reviewed-By: Michael Dawson Reviewed-By: Gabriel Schulhof Reviewed-By: Nicola Del Gobbo --- napi-inl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/napi-inl.h b/napi-inl.h index ff84d88..babbebd 100644 --- a/napi-inl.h +++ b/napi-inl.h @@ -3588,11 +3588,11 @@ inline FunctionReference& AsyncWorker::Callback() { } inline void AsyncWorker::OnOK() { - _callback.MakeCallback(_receiver.Value(), std::initializer_list{}); + _callback.Call(_receiver.Value(), std::initializer_list{}); } inline void AsyncWorker::OnError(const Error& e) { - _callback.MakeCallback(_receiver.Value(), std::initializer_list{ e.Value() }); + _callback.Call(_receiver.Value(), std::initializer_list{ e.Value() }); } inline void AsyncWorker::SetError(const std::string& error) {