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

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

Issue 17588005: Warn about overriding operator== but not hashCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update comments (according to my dictionary whitelist is a word). Created 7 years, 6 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
Index: dart/tests/compiler/dart2js/analyze_helper.dart
diff --git a/dart/tests/compiler/dart2js/analyze_helper.dart b/dart/tests/compiler/dart2js/analyze_helper.dart
index c3e6729506de0ff985e053ae43b906bc7decc633..a9c081df39e758ed31cfceed96514b76798719dd 100644
--- a/dart/tests/compiler/dart2js/analyze_helper.dart
+++ b/dart/tests/compiler/dart2js/analyze_helper.dart
@@ -14,19 +14,20 @@ import '../../../sdk/lib/_internal/compiler/implementation/filenames.dart';
import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider.dart';
/**
- * Map of white-listed warnings and errors.
+ * Map of whitelisted warnings and errors.
*
- * Only add a white-listing together with a bug report to dartbug.com and add
- * the bug issue number as a comment on the white-listing.
+ * Only add a whitelisting together with a bug report to dartbug.com and add
+ * the bug issue number as a comment on the whitelisting.
*
* Use an identifiable suffix of the file uri as key. Use a fixed substring of
- * the error/warning message in the list of white-listings for each file.
+ * the error/warning message in the list of whitelistings for each file.
*/
// TODO(johnniwinther): Support canonical URIs as keys and message kinds as
// values.
class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
bool hasWarnings = false;
+ bool hasHint = false;
bool hasErrors = false;
Map<String, Map<String, int>> whiteListMap
@@ -46,6 +47,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
void checkResults() {
Expect.isFalse(hasWarnings);
+ Expect.isFalse(hasHint);
Expect.isFalse(hasErrors);
Expect.isTrue(checkWhiteListUse());
reportWhiteListUse();
@@ -56,8 +58,8 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
for (String file in whiteListMap.keys) {
for (String messagePart in whiteListMap[file].keys) {
if (whiteListMap[file][messagePart] == 0) {
- print("White-listing '$messagePart' is unused in '$file'. "
- "Remove the white-listing from the white list map.");
+ print("Whitelisting '$messagePart' is unused in '$file'. "
+ "Remove the whitelisting from the whitelist map.");
allUsed = false;
}
}
@@ -69,7 +71,7 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
for (String file in whiteListMap.keys) {
for (String messagePart in whiteListMap[file].keys) {
int useCount = whiteListMap[file][messagePart];
- print("White-listed message '$messagePart' suppressed $useCount "
+ print("Whitelisted message '$messagePart' suppressed $useCount "
"time(s) in '$file'.");
}
}
@@ -97,14 +99,21 @@ class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
api.Diagnostic kind) {
if (kind == api.Diagnostic.WARNING) {
if (checkWhiteList(uri, message)) {
- // Suppress white listed warnings.
+ // Suppress whitelisted warnings.
return;
}
hasWarnings = true;
}
+ if (kind == api.Diagnostic.HINT) {
+ if (checkWhiteList(uri, message)) {
+ // Suppress whitelisted hints.
+ return;
+ }
+ hasHint = true;
+ }
if (kind == api.Diagnostic.ERROR) {
if (checkWhiteList(uri, message)) {
- // Suppress white listed warnings.
+ // Suppress whitelisted errors.
return;
}
hasErrors = true;

Powered by Google App Engine
This is Rietveld 408576698