From fb07807e9a80889e94044dc98d5315c77e7718a9 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 13 Mar 2025 14:41:32 -0700 Subject: [PATCH] src: make minor cleanups in encoding_binding.cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/57448 Reviewed-By: Yagiz Nizipli Reviewed-By: Juan José Arboleda Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum --- src/encoding_binding.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/encoding_binding.cc b/src/encoding_binding.cc index 9bdb2a66036..61d692dfe5f 100644 --- a/src/encoding_binding.cc +++ b/src/encoding_binding.cc @@ -18,10 +18,12 @@ using v8::BackingStore; using v8::BackingStoreInitializationMode; using v8::Context; using v8::FunctionCallbackInfo; +using v8::HandleScope; using v8::Isolate; using v8::Local; using v8::Object; using v8::ObjectTemplate; +using v8::SnapshotCreator; using v8::String; using v8::Uint8Array; using v8::Value; @@ -32,7 +34,7 @@ void BindingData::MemoryInfo(MemoryTracker* tracker) const { } BindingData::BindingData(Realm* realm, - v8::Local object, + Local object, InternalFieldInfo* info) : SnapshotableObject(realm, object, type_int), encode_into_results_buffer_( @@ -52,7 +54,7 @@ BindingData::BindingData(Realm* realm, } bool BindingData::PrepareForSerialization(Local context, - v8::SnapshotCreator* creator) { + SnapshotCreator* creator) { DCHECK_NULL(internal_field_info_); internal_field_info_ = InternalFieldInfoBase::New(type()); internal_field_info_->encode_into_results_buffer = @@ -74,7 +76,7 @@ void BindingData::Deserialize(Local context, int index, InternalFieldInfoBase* info) { DCHECK_IS_SNAPSHOT_SLOT(index); - v8::HandleScope scope(context->GetIsolate()); + HandleScope scope(context->GetIsolate()); Realm* realm = Realm::GetCurrent(context); // Recreate the buffer in the constructor. InternalFieldInfo* casted_info = static_cast(info); @@ -194,7 +196,7 @@ void BindingData::DecodeUTF8(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(ret); } -void BindingData::ToASCII(const v8::FunctionCallbackInfo& args) { +void BindingData::ToASCII(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK_GE(args.Length(), 1); CHECK(args[0]->IsString()); @@ -207,7 +209,7 @@ void BindingData::ToASCII(const v8::FunctionCallbackInfo& args) { } } -void BindingData::ToUnicode(const v8::FunctionCallbackInfo& args) { +void BindingData::ToUnicode(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK_GE(args.Length(), 1); CHECK(args[0]->IsString());