Index: runtime/vm/isolate_reload.cc |
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc |
index 583341182337ad54365cee2f101074df1a4b7c1b..871b91af6996d96165024c7e7fa54a2c4e5376d2 100644 |
--- a/runtime/vm/isolate_reload.cc |
+++ b/runtime/vm/isolate_reload.cc |
@@ -202,7 +202,7 @@ void ReasonForCancelling::AppendTo(JSONArray* array) { |
JSONObject jsobj(array); |
jsobj.AddProperty("type", "ReasonForCancelling"); |
const String& message = String::Handle(ToString()); |
- jsobj.AddProperty("message", message); |
+ jsobj.AddProperty("message", message.ToCString()); |
} |
@@ -211,7 +211,7 @@ void ClassReasonForCancelling::AppendTo(JSONArray* array) { |
jsobj.AddProperty("type", "ReasonForCancelling"); |
jsobj.AddProperty("class", from_); |
const String& message = String::Handle(ToString()); |
- jsobj.AddProperty("message", message); |
+ jsobj.AddProperty("message", message.ToCString()); |
} |
@@ -486,6 +486,9 @@ void IsolateReloadContext::Reload(bool force_reload) { |
if (result.IsError()) { |
const Error& error = Error::Cast(result); |
AddReasonForCancelling(new Aborted(zone_, error)); |
+ // We call report on JSON here because we won't ever execute |
+ // FinalizeLoading. |
+ ReportOnJSON(js_); |
} |
} |
@@ -537,9 +540,6 @@ void IsolateReloadContext::FinalizeLoading() { |
RebuildDirectSubclasses(); |
BackgroundCompiler::Enable(); |
- |
- reload_aborted_ = HasReasonsForCancelling(); |
- ReportOnJSON(js_); |
} |
@@ -1113,6 +1113,7 @@ void IsolateReloadContext::PostCommit() { |
void IsolateReloadContext::AddReasonForCancelling(ReasonForCancelling* reason) { |
+ reload_aborted_ = true; |
reasons_to_cancel_reload_.Add(reason); |
} |