Skip to content

Commit 74205b3

Browse files
XadillaXdanielleadams
authored andcommitted
src: replace autos in node_api.cc
PR-URL: #38852 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 120849f commit 74205b3

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/node_api.cc

+14-11
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ struct napi_async_cleanup_hook_handle__ {
698698
}
699699

700700
static void Hook(void* data, void (*done_cb)(void*), void* done_data) {
701-
auto handle = static_cast<napi_async_cleanup_hook_handle__*>(data);
701+
napi_async_cleanup_hook_handle__* handle =
702+
static_cast<napi_async_cleanup_hook_handle__*>(data);
702703
handle->done_cb_ = done_cb;
703704
handle->done_data_ = done_data;
704705
handle->user_hook_(handle, handle->user_data_);
@@ -832,7 +833,7 @@ napi_status napi_async_init(napi_env env,
832833
v8::Local<v8::String> v8_resource_name;
833834
CHECK_TO_STRING(env, context, v8_resource_name, async_resource_name);
834835

835-
auto async_context =
836+
v8impl::AsyncContext* async_context =
836837
new v8impl::AsyncContext(reinterpret_cast<node_napi_env>(env),
837838
v8_resource,
838839
v8_resource_name,
@@ -888,7 +889,7 @@ napi_status napi_make_callback(napi_env env,
888889
reinterpret_cast<v8::Local<v8::Value>*>(const_cast<napi_value*>(argv)),
889890
{0, 0});
890891
} else {
891-
auto node_async_context =
892+
v8impl::AsyncContext* node_async_context =
892893
reinterpret_cast<v8impl::AsyncContext*>(async_context);
893894
callback_result = node_async_context->MakeCallback(
894895
v8recv,
@@ -917,7 +918,7 @@ napi_status napi_create_buffer(napi_env env,
917918
NAPI_PREAMBLE(env);
918919
CHECK_ARG(env, result);
919920

920-
auto maybe = node::Buffer::New(env->isolate, length);
921+
v8::MaybeLocal<v8::Object> maybe = node::Buffer::New(env->isolate, length);
921922

922923
CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
923924

@@ -948,11 +949,12 @@ napi_status napi_create_external_buffer(napi_env env,
948949
env, finalize_cb, nullptr, finalize_hint,
949950
v8impl::Finalizer::kKeepEnvReference);
950951

951-
auto maybe = node::Buffer::New(isolate,
952-
static_cast<char*>(data),
953-
length,
954-
v8impl::BufferFinalizer::FinalizeBufferCallback,
955-
finalizer);
952+
v8::MaybeLocal<v8::Object> maybe = node::Buffer::New(
953+
isolate,
954+
static_cast<char*>(data),
955+
length,
956+
v8impl::BufferFinalizer::FinalizeBufferCallback,
957+
finalizer);
956958

957959
CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
958960

@@ -972,8 +974,9 @@ napi_status napi_create_buffer_copy(napi_env env,
972974
NAPI_PREAMBLE(env);
973975
CHECK_ARG(env, result);
974976

975-
auto maybe = node::Buffer::Copy(env->isolate,
976-
static_cast<const char*>(data), length);
977+
v8::MaybeLocal<v8::Object> maybe = node::Buffer::Copy(
978+
env->isolate,
979+
static_cast<const char*>(data), length);
977980

978981
CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
979982

0 commit comments

Comments
 (0)