Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: runtime/vm/exceptions.cc

Issue 1815733003: Remove recently introduced FunctionType vm class by merging it into class Type. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 654f7f63ca9eed5559408136c3310a9f5b4351f5..e2fa84e5de257b8ab4ce9ffa99bc395a877e3bc2 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -493,12 +493,24 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
pieces.Add(Symbols::SingleQuote());
}
// Print URIs of src and dst types.
- pieces.Add(Symbols::SpaceWhereNewLine());
+ // Do not print "where" when no URIs get printed.
+ bool printed_where = false;
if (!src_type.IsNull()) {
- pieces.Add(String::Handle(zone, src_type.EnumerateURIs()));
+ const String& uris = String::Handle(zone, src_type.EnumerateURIs());
+ if (uris.Length() > Symbols::SpaceIsFromSpace().Length()) {
+ printed_where = true;
+ pieces.Add(Symbols::SpaceWhereNewLine());
+ pieces.Add(uris);
+ }
}
if (!dst_type.IsDynamicType() && !dst_type.IsVoidType()) {
- pieces.Add(String::Handle(zone, dst_type.EnumerateURIs()));
+ const String& uris = String::Handle(zone, dst_type.EnumerateURIs());
+ if (uris.Length() > Symbols::SpaceIsFromSpace().Length()) {
+ if (!printed_where) {
+ pieces.Add(Symbols::SpaceWhereNewLine());
+ }
+ pieces.Add(uris);
+ }
}
}
}
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698