@@ -76,8 +76,6 @@ struct ThreadResult {
7676};
7777
7878std::string JSONStringify (Isolate *isolate, Local<Value> value) {
79- HandleScope handle_scope (isolate);
80-
8179 auto context = isolate->GetCurrentContext ();
8280 auto maybe_json = v8::JSON::Stringify (context, value);
8381 if (maybe_json.IsEmpty ()) {
@@ -89,8 +87,6 @@ std::string JSONStringify(Isolate *isolate, Local<Value> value) {
8987
9088// Function to get stack frames from a V8 stack trace
9189JsStackFrames GetStackFrames (Isolate *isolate) {
92- HandleScope handle_scope (isolate);
93-
9490 auto stack = StackTrace::CurrentStackTrace (isolate, kMaxStackFrames ,
9591 StackTrace::kDetailed );
9692
@@ -135,8 +131,6 @@ JsStackFrames GetStackFrames(Isolate *isolate) {
135131// Function to fetch the thread state from the async context store
136132std::string GetThreadState (Isolate *isolate,
137133 const AsyncLocalStorageLookup &store) {
138- HandleScope handle_scope (isolate);
139-
140134 // Node.js stores the async local storage in the isolate's
141135 // "ContinuationPreservedEmbedderData" map, keyed by the
142136 // AsyncLocalStorage instance.
@@ -232,7 +226,6 @@ CaptureStackTrace(Isolate *isolate,
232226// Function to capture stack traces from all registered threads
233227void CaptureStackTraces (const FunctionCallbackInfo<Value> &args) {
234228 auto capture_from_isolate = args.GetIsolate ();
235- HandleScope handle_scope (capture_from_isolate);
236229
237230 std::vector<ThreadResult> results;
238231
@@ -401,7 +394,6 @@ void RegisterThreadInternal(
401394// Function to register a thread and update its last seen time
402395void RegisterThread (const FunctionCallbackInfo<Value> &args) {
403396 auto isolate = args.GetIsolate ();
404- HandleScope handle_scope (isolate);
405397
406398 if (args.Length () == 1 && args[0 ]->IsString ()) {
407399 v8::String::Utf8Value utf8 (isolate, args[0 ]);
@@ -491,7 +483,6 @@ steady_clock::time_point GetUnbiasedMonotonicTime() {
491483// Function to track a thread and set its state
492484void ThreadPoll (const FunctionCallbackInfo<Value> &args) {
493485 auto isolate = args.GetIsolate ();
494- HandleScope handle_scope (isolate);
495486
496487 bool enable_last_seen = true ;
497488 if (args.Length () > 0 && args[0 ]->IsBoolean ()) {
@@ -524,7 +515,6 @@ void ThreadPoll(const FunctionCallbackInfo<Value> &args) {
524515// Function to get the last seen time of all registered threads
525516void GetThreadsLastSeen (const FunctionCallbackInfo<Value> &args) {
526517 Isolate *isolate = args.GetIsolate ();
527- HandleScope handle_scope (isolate);
528518
529519 Local<Object> result = Object::New (isolate);
530520 milliseconds now = duration_cast<milliseconds>(
0 commit comments