Skip to content

Commit 8a1eaea

Browse files
Aditi-1400targos
authored andcommitted
src: update std::vector<v8::Local<T>> to use v8::LocalVector<T>
PR-URL: #58500 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 8d2ba38 commit 8a1eaea

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/quic/streams.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class Stream final : public AsyncWrap,
332332
// The headers_ field holds a block of headers that have been received and
333333
// are being buffered for delivery to the JavaScript side.
334334
// TODO(@jasnell): Use v8::Global instead of v8::Local here.
335-
std::vector<v8::Local<v8::Value>> headers_;
335+
v8::LocalVector<v8::Value> headers_;
336336

337337
// The headers_kind_ field indicates the kind of headers that are being
338338
// buffered.

test/addons/make-callback/binding.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void MakeCallback(const v8::FunctionCallbackInfo<v8::Value>& args) {
1111
assert(args[1]->IsFunction() || args[1]->IsString());
1212
auto isolate = args.GetIsolate();
1313
auto recv = args[0].As<v8::Object>();
14-
std::vector<v8::Local<v8::Value>> argv;
14+
v8::LocalVector<v8::Value> argv(isolate);
1515
for (size_t n = 2; n < static_cast<size_t>(args.Length()); n += 1) {
1616
argv.push_back(args[n]);
1717
}

test/addons/openssl-providers/binding.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ using v8::Context;
1313
using v8::FunctionCallbackInfo;
1414
using v8::Isolate;
1515
using v8::Local;
16+
using v8::LocalVector;
1617
using v8::Object;
1718
using v8::String;
1819
using v8::Value;
@@ -26,7 +27,7 @@ int collectProviders(OSSL_PROVIDER* provider, void* cbdata) {
2627

2728
inline void GetProviders(const FunctionCallbackInfo<Value>& args) {
2829
Isolate* isolate = args.GetIsolate();
29-
std::vector<Local<Value>> arr = {};
30+
LocalVector<Value> arr(isolate, 0);
3031
#if OPENSSL_VERSION_MAJOR >= 3
3132
std::vector<OSSL_PROVIDER*> providers;
3233
OSSL_PROVIDER_do_all(nullptr, &collectProviders, &providers);

0 commit comments

Comments
 (0)