@@ -50,6 +50,7 @@ using v8::HeapStatistics;
5050using v8::Integer;
5151using v8::Isolate;
5252using v8::Local;
53+ using v8::LocalVector;
5354using v8::Maybe;
5455using v8::NewStringType;
5556using v8::Number;
@@ -289,7 +290,7 @@ static void Uptime(const FunctionCallbackInfo<Value>& args) {
289290static void GetActiveRequests (const FunctionCallbackInfo<Value>& args) {
290291 Environment* env = Environment::GetCurrent (args);
291292
292- std::vector<Local< Value>> request_v;
293+ LocalVector< Value> request_v (env-> isolate ()) ;
293294 for (ReqWrapBase* req_wrap : *env->req_wrap_queue ()) {
294295 AsyncWrap* w = req_wrap->GetAsyncWrap ();
295296 if (w->persistent ().IsEmpty ())
@@ -306,7 +307,7 @@ static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
306307void GetActiveHandles (const FunctionCallbackInfo<Value>& args) {
307308 Environment* env = Environment::GetCurrent (args);
308309
309- std::vector<Local< Value>> handle_v;
310+ LocalVector< Value> handle_v (env-> isolate ()) ;
310311 for (auto w : *env->handle_wrap_queue ()) {
311312 if (!HandleWrap::HasRef (w))
312313 continue ;
@@ -318,7 +319,7 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) {
318319
319320static void GetActiveResourcesInfo (const FunctionCallbackInfo<Value>& args) {
320321 Environment* env = Environment::GetCurrent (args);
321- std::vector<Local< Value>> resources_info;
322+ LocalVector< Value> resources_info (env-> isolate ()) ;
322323
323324 // Active requests
324325 for (ReqWrapBase* req_wrap : *env->req_wrap_queue ()) {
@@ -336,14 +337,15 @@ static void GetActiveResourcesInfo(const FunctionCallbackInfo<Value>& args) {
336337 }
337338
338339 // Active timeouts
339- resources_info. insert (resources_info. end (),
340- env->timeout_info ()[ 0 ],
341- FIXED_ONE_BYTE_STRING (env-> isolate (), " Timeout " ));
340+ for ( int i = 0 ; i < env-> timeout_info ()[ 0 ]; ++i) {
341+ resources_info. push_back ( FIXED_ONE_BYTE_STRING ( env->isolate (), " Timeout " ));
342+ }
342343
343344 // Active immediates
344- resources_info.insert (resources_info.end (),
345- env->immediate_info ()->ref_count (),
346- FIXED_ONE_BYTE_STRING (env->isolate (), " Immediate" ));
345+ for (uint32_t i = 0 ; i < env->immediate_info ()->ref_count (); ++i) {
346+ resources_info.push_back (
347+ FIXED_ONE_BYTE_STRING (env->isolate (), " Immediate" ));
348+ }
347349
348350 args.GetReturnValue ().Set (
349351 Array::New (env->isolate (), resources_info.data (), resources_info.size ()));
0 commit comments