@@ -467,18 +467,13 @@ void CaptureStackTraces(const FunctionCallbackInfo<Value> &args) {
467467 capture_from_isolate, result.poll_state .c_str (),
468468 NewStringType::kNormal );
469469 if (!stateStr.IsEmpty ()) {
470- v8::MaybeLocal<v8::Value> maybeStateVal =
471- v8::JSON::Parse (current_context, stateStr.ToLocalChecked ());
472- v8::Local<v8::Value> stateVal;
473- if (maybeStateVal.ToLocal (&stateVal)) {
474- threadObj
475- ->Set (current_context,
476- String::NewFromUtf8 (capture_from_isolate, " pollState" ,
477- NewStringType::kInternalized )
478- .ToLocalChecked (),
479- stateVal)
480- .Check ();
481- }
470+ threadObj
471+ ->Set (current_context,
472+ String::NewFromUtf8 (capture_from_isolate, " pollState" ,
473+ NewStringType::kInternalized )
474+ .ToLocalChecked (),
475+ stateStr.ToLocalChecked ())
476+ .Check ();
482477 }
483478 }
484479
@@ -487,18 +482,13 @@ void CaptureStackTraces(const FunctionCallbackInfo<Value> &args) {
487482 capture_from_isolate, result.stack_trace .async_state .c_str (),
488483 NewStringType::kNormal );
489484 if (!stateStr.IsEmpty ()) {
490- v8::MaybeLocal<v8::Value> maybeStateVal =
491- v8::JSON::Parse (current_context, stateStr.ToLocalChecked ());
492- v8::Local<v8::Value> stateVal;
493- if (maybeStateVal.ToLocal (&stateVal)) {
494- threadObj
495- ->Set (current_context,
496- String::NewFromUtf8 (capture_from_isolate, " asyncState" ,
497- NewStringType::kInternalized )
498- .ToLocalChecked (),
499- stateVal)
500- .Check ();
501- }
485+ threadObj
486+ ->Set (current_context,
487+ String::NewFromUtf8 (capture_from_isolate, " asyncState" ,
488+ NewStringType::kInternalized )
489+ .ToLocalChecked (),
490+ stateStr.ToLocalChecked ())
491+ .Check ();
502492 }
503493 }
504494
0 commit comments