Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXadillaX <i@2333.moe>2021-05-30 11:20:47 +0300
committerDanielle Adams <adamzdanielle@gmail.com>2021-06-02 20:22:15 +0300
commit74205b3542cf0f3a7d5ac433358faa0543443da4 (patch)
treeee694f16437d42178f75588dfbcaa5f7c5b990ca /src
parent120849f609a92339e5f94826afc86a24301a23fb (diff)
src: replace `auto`s in node_api.cc
PR-URL: https://github.com/nodejs/node/pull/38852 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_api.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/node_api.cc b/src/node_api.cc
index f28ca121932..3fcc9ecbf4a 100644
--- a/src/node_api.cc
+++ b/src/node_api.cc
@@ -698,7 +698,8 @@ struct napi_async_cleanup_hook_handle__ {
}
static void Hook(void* data, void (*done_cb)(void*), void* done_data) {
- auto handle = static_cast<napi_async_cleanup_hook_handle__*>(data);
+ napi_async_cleanup_hook_handle__* handle =
+ static_cast<napi_async_cleanup_hook_handle__*>(data);
handle->done_cb_ = done_cb;
handle->done_data_ = done_data;
handle->user_hook_(handle, handle->user_data_);
@@ -832,7 +833,7 @@ napi_status napi_async_init(napi_env env,
v8::Local<v8::String> 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<node_napi_env>(env),
v8_resource,
v8_resource_name,
@@ -888,7 +889,7 @@ napi_status napi_make_callback(napi_env env,
reinterpret_cast<v8::Local<v8::Value>*>(const_cast<napi_value*>(argv)),
{0, 0});
} else {
- auto node_async_context =
+ v8impl::AsyncContext* node_async_context =
reinterpret_cast<v8impl::AsyncContext*>(async_context);
callback_result = node_async_context->MakeCallback(
v8recv,
@@ -917,7 +918,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<v8::Object> maybe = node::Buffer::New(env->isolate, length);
CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
@@ -948,11 +949,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<char*>(data),
- length,
- v8impl::BufferFinalizer::FinalizeBufferCallback,
- finalizer);
+ v8::MaybeLocal<v8::Object> maybe = node::Buffer::New(
+ isolate,
+ static_cast<char*>(data),
+ length,
+ v8impl::BufferFinalizer::FinalizeBufferCallback,
+ finalizer);
CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);
@@ -972,8 +974,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<const char*>(data), length);
+ v8::MaybeLocal<v8::Object> maybe = node::Buffer::Copy(
+ env->isolate,
+ static_cast<const char*>(data), length);
CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure);