@@ -50,6 +50,7 @@ using v8::HeapStatistics;
50
50
using v8::Integer;
51
51
using v8::Isolate;
52
52
using v8::Local;
53
+ using v8::LocalVector;
53
54
using v8::Maybe;
54
55
using v8::NewStringType;
55
56
using v8::Number;
@@ -265,7 +266,7 @@ static void Uptime(const FunctionCallbackInfo<Value>& args) {
265
266
static void GetActiveRequests (const FunctionCallbackInfo<Value>& args) {
266
267
Environment* env = Environment::GetCurrent (args);
267
268
268
- std::vector<Local< Value>> request_v;
269
+ LocalVector< Value> request_v (env-> isolate ()) ;
269
270
for (ReqWrapBase* req_wrap : *env->req_wrap_queue ()) {
270
271
AsyncWrap* w = req_wrap->GetAsyncWrap ();
271
272
if (w->persistent ().IsEmpty ())
@@ -282,7 +283,7 @@ static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
282
283
void GetActiveHandles (const FunctionCallbackInfo<Value>& args) {
283
284
Environment* env = Environment::GetCurrent (args);
284
285
285
- std::vector<Local< Value>> handle_v;
286
+ LocalVector< Value> handle_v (env-> isolate ()) ;
286
287
for (auto w : *env->handle_wrap_queue ()) {
287
288
if (!HandleWrap::HasRef (w))
288
289
continue ;
@@ -294,7 +295,7 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
294
295
295
296
static void GetActiveResourcesInfo (const FunctionCallbackInfo<Value>& args) {
296
297
Environment* env = Environment::GetCurrent (args);
297
- std::vector<Local< Value>> resources_info;
298
+ LocalVector< Value> resources_info (env-> isolate ()) ;
298
299
299
300
// Active requests
300
301
for (ReqWrapBase* req_wrap : *env->req_wrap_queue ()) {
@@ -312,14 +313,17 @@ static void GetActiveResourcesInfo(const FunctionCallbackInfo<Value>& args) {
312
313
}
313
314
314
315
// Active timeouts
315
- resources_info.insert (resources_info.end (),
316
- env->timeout_info ()[0 ],
317
- FIXED_ONE_BYTE_STRING (env->isolate (), " Timeout" ));
316
+ Local<Value> timeout_str = FIXED_ONE_BYTE_STRING (env->isolate (), " Timeout" );
317
+ for (int i = 0 ; i < env->timeout_info ()[0 ]; ++i) {
318
+ resources_info.push_back (timeout_str);
319
+ }
318
320
319
321
// Active immediates
320
- resources_info.insert (resources_info.end (),
321
- env->immediate_info ()->ref_count (),
322
- FIXED_ONE_BYTE_STRING (env->isolate (), " Immediate" ));
322
+ Local<Value> immediate_str =
323
+ FIXED_ONE_BYTE_STRING (env->isolate (), " Immediate" );
324
+ for (uint32_t i = 0 ; i < env->immediate_info ()->ref_count (); ++i) {
325
+ resources_info.push_back (immediate_str);
326
+ }
323
327
324
328
args.GetReturnValue ().Set (
325
329
Array::New (env->isolate (), resources_info.data (), resources_info.size ()));
0 commit comments