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

Unified Diff: pkg/analyzer/lib/src/generated/java_core.dart

Issue 1059263004: Fix ill-formatted error messages in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « no previous file | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/java_core.dart
diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart
index 4f6707232598ae07fdc684c4f2de2b7fa278a8ca..9a0185a0ae461b7c65929984c9ed65221e6f2b0e 100644
--- a/pkg/analyzer/lib/src/generated/java_core.dart
+++ b/pkg/analyzer/lib/src/generated/java_core.dart
@@ -25,12 +25,14 @@ String format(String pattern,
*/
String formatList(String pattern, List<Object> arguments) {
if (arguments == null || arguments.isEmpty) {
+ assert(!pattern.contains(new RegExp(r'\{(\d+)\}')));
return pattern;
}
return pattern.replaceAllMapped(new RegExp(r'\{(\d+)\}'), (match) {
String indexStr = match.group(1);
int index = int.parse(indexStr);
Object arg = arguments[index];
+ assert(arg != null);
return arg != null ? arg.toString() : null;
});
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698