src: update std::vector<v8::Local<T>> to use v8::LocalVector<T>

PR-URL: https://github.com/nodejs/node/pull/58500
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
Aditi 2025-06-01 00:28:07 +05:30 committed by Antoine du Hamel
parent 8b41429499
commit 50bdd94e0b
No known key found for this signature in database
GPG Key ID: 21D900FFDB233756
3 changed files with 4 additions and 3 deletions

View File

@ -203,7 +203,7 @@ class Stream : public AsyncWrap,
std::unique_ptr<Outbound> outbound_;
std::shared_ptr<DataQueue> inbound_;
std::vector<v8::Local<v8::Value>> headers_;
v8::LocalVector<v8::Value> headers_;
HeadersKind headers_kind_ = HeadersKind::INITIAL;
size_t headers_length_ = 0;

View File

@ -11,7 +11,7 @@ void MakeCallback(const v8::FunctionCallbackInfo<v8::Value>& args) {
assert(args[1]->IsFunction() || args[1]->IsString());
auto isolate = args.GetIsolate();
auto recv = args[0].As<v8::Object>();
std::vector<v8::Local<v8::Value>> argv;
v8::LocalVector<v8::Value> argv(isolate);
for (size_t n = 2; n < static_cast<size_t>(args.Length()); n += 1) {
argv.push_back(args[n]);
}

View File

@ -13,6 +13,7 @@ using v8::Context;
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::LocalVector;
using v8::Object;
using v8::String;
using v8::Value;
@ -26,7 +27,7 @@ int collectProviders(OSSL_PROVIDER* provider, void* cbdata) {
inline void GetProviders(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
std::vector<Local<Value>> arr = {};
LocalVector<Value> arr(isolate, 0);
#if OPENSSL_VERSION_MAJOR >= 3
std::vector<OSSL_PROVIDER*> providers;
OSSL_PROVIDER_do_all(nullptr, &collectProviders, &providers);