File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -65,20 +65,19 @@ struct ToStringHelper {
6565
6666 static std::string Convert (v8::Local<v8::Value> value) {
6767 v8::Isolate* isolate = v8::Isolate::GetCurrent ();
68- v8::TryCatch scope (isolate);
69- if (value->IsSymbol ()) {
70- Utf8Value utf8_value (isolate,
71- value.As <v8::Symbol>()->Description (isolate));
72- return SPrintF (" <Symbol: %s>" , utf8_value.ToString ());
73- }
7468 if (value->IsString ()) {
7569 Utf8Value utf8_value (isolate, value);
7670 return SPrintF (" \" %s\" " , utf8_value.ToString ());
7771 }
78- Utf8Value utf8_value (isolate, value);
79- if (scope.HasCaught ()) {
72+ v8::MaybeLocal<v8::String> maybe_detail =
73+ value->ToDetailString (isolate->GetCurrentContext ());
74+ v8::Local<v8::String> detail;
75+ if (!maybe_detail.ToLocal (&detail)) {
76+ // This will only occur when terminating. No exception is expected
77+ // with `ToDetailString`.
8078 return " <Unable to stringify v8::Value>" ;
8179 }
80+ Utf8Value utf8_value (isolate, detail);
8281 return utf8_value.ToString ();
8382 }
8483
You can’t perform that action at this time.
0 commit comments