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

Unified Diff: dart/tests/compiler/dart2js/message_kind_helper.dart

Issue 23606010: Fix various parser bugs related to modifiers of top-level and class members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments. Created 7 years, 3 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 | « dart/tests/co19/co19-dart2js.status ('k') | dart/tests/compiler/dart2js/message_kind_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/compiler/dart2js/message_kind_helper.dart
diff --git a/dart/tests/compiler/dart2js/message_kind_helper.dart b/dart/tests/compiler/dart2js/message_kind_helper.dart
index 6302bf190608302f6e25b8b008093c02377840c4..b7163fe8369661572f6b0ebb4ab7ffd982207404 100644
--- a/dart/tests/compiler/dart2js/message_kind_helper.dart
+++ b/dart/tests/compiler/dart2js/message_kind_helper.dart
@@ -14,13 +14,8 @@ import 'memory_compiler.dart';
const String ESCAPE_REGEXP = r'[[\]{}()*+?.\\^$|]';
-Compiler check(MessageKind kind, Compiler cachedCompiler,
- {bool expectNoHowToFix: false}) {
- if (expectNoHowToFix) {
- Expect.isNull(kind.howToFix);
- } else {
- Expect.isNotNull(kind.howToFix);
- }
+Compiler check(MessageKind kind, Compiler cachedCompiler) {
+ Expect.isNotNull(kind.howToFix);
Expect.isFalse(kind.examples.isEmpty);
for (String example in kind.examples) {
@@ -42,7 +37,7 @@ Compiler check(MessageKind kind, Compiler cachedCompiler,
Expect.isFalse(messages.isEmpty, 'No messages in """$example"""');
- String expectedText = kind.howToFix == null
+ String expectedText = !kind.hasHowToFix
? kind.template : '${kind.template}\n${kind.howToFix}';
String pattern = expectedText.replaceAllMapped(
new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}');
@@ -52,6 +47,8 @@ Compiler check(MessageKind kind, Compiler cachedCompiler,
Expect.isTrue(new RegExp('^$pattern\$').hasMatch(message),
'"$pattern" does not match "$message"');
}
- return compiler;
+ cachedCompiler = compiler;
}
+
+ return cachedCompiler;
}
« no previous file with comments | « dart/tests/co19/co19-dart2js.status ('k') | dart/tests/compiler/dart2js/message_kind_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698