diff --git a/src/node_api.cc b/src/node_api.cc index 36b63ccf4ef759..de5727d0694ae9 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -673,7 +673,8 @@ struct napi_async_cleanup_hook_handle__ { } static void Hook(void* data, void (*done_cb)(void*), void* done_data) { - auto handle = static_cast(data); + napi_async_cleanup_hook_handle__* handle = + static_cast(data); handle->done_cb_ = done_cb; handle->done_data_ = done_data; handle->user_hook_(handle, handle->user_data_); @@ -807,7 +808,7 @@ napi_status napi_async_init(napi_env env, v8::Local v8_resource_name; CHECK_TO_STRING(env, context, v8_resource_name, async_resource_name); - auto async_context = + v8impl::AsyncContext* async_context = new v8impl::AsyncContext(reinterpret_cast(env), v8_resource, v8_resource_name, @@ -863,7 +864,7 @@ napi_status napi_make_callback(napi_env env, reinterpret_cast*>(const_cast(argv)), {0, 0}); } else { - auto node_async_context = + v8impl::AsyncContext* node_async_context = reinterpret_cast(async_context); callback_result = node_async_context->MakeCallback( v8recv, @@ -892,7 +893,7 @@ napi_status napi_create_buffer(napi_env env, NAPI_PREAMBLE(env); CHECK_ARG(env, result); - auto maybe = node::Buffer::New(env->isolate, length); + v8::MaybeLocal maybe = node::Buffer::New(env->isolate, length); CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure); @@ -923,11 +924,12 @@ napi_status napi_create_external_buffer(napi_env env, env, finalize_cb, nullptr, finalize_hint, v8impl::Finalizer::kKeepEnvReference); - auto maybe = node::Buffer::New(isolate, - static_cast(data), - length, - v8impl::BufferFinalizer::FinalizeBufferCallback, - finalizer); + v8::MaybeLocal maybe = node::Buffer::New( + isolate, + static_cast(data), + length, + v8impl::BufferFinalizer::FinalizeBufferCallback, + finalizer); CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure); @@ -947,8 +949,9 @@ napi_status napi_create_buffer_copy(napi_env env, NAPI_PREAMBLE(env); CHECK_ARG(env, result); - auto maybe = node::Buffer::Copy(env->isolate, - static_cast(data), length); + v8::MaybeLocal maybe = node::Buffer::Copy( + env->isolate, + static_cast(data), length); CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);