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

Unified Diff: pkg/analyzer/test/generated/test_support.dart

Issue 109853003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 7 years 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 | « pkg/analyzer/test/generated/resolver_test.dart ('k') | pkg/intl/lib/extract_messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/test_support.dart
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 91f0ba69581b68b16e599a981f0aa753acf180e7..8186ce4ce1d1875e7f891c85ec5c4812ad93d52f 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -32,7 +32,7 @@ class GatheringErrorListener implements AnalysisErrorListener {
/**
* A list containing the errors that were collected.
*/
- final List<AnalysisError> errors = new List<AnalysisError>();
+ List<AnalysisError> _errors = new List<AnalysisError>();
/**
* A table mapping sources to the line information for the source.
@@ -78,14 +78,14 @@ class GatheringErrorListener implements AnalysisErrorListener {
* expected or if they do not have the same codes and locations
*/
void assertErrors(List<AnalysisError> expectedErrors) {
- if (errors.length != expectedErrors.length) {
+ if (_errors.length != expectedErrors.length) {
fail(expectedErrors);
}
List<AnalysisError> remainingErrors = new List<AnalysisError>();
for (AnalysisError error in expectedErrors) {
remainingErrors.add(error);
}
- for (AnalysisError error in errors) {
+ for (AnalysisError error in _errors) {
if (!foundAndRemoved(remainingErrors, error)) {
fail(expectedErrors);
}
@@ -117,7 +117,7 @@ class GatheringErrorListener implements AnalysisErrorListener {
expectedCounts[code] = count;
}
Map<ErrorCode, List<AnalysisError>> errorsByCode = new Map<ErrorCode, List<AnalysisError>>();
- for (AnalysisError error in errors) {
+ for (AnalysisError error in _errors) {
ErrorCode code = error.errorCode;
List<AnalysisError> list = errorsByCode[code];
if (list == null) {
@@ -198,7 +198,7 @@ class GatheringErrorListener implements AnalysisErrorListener {
}
int actualErrorCount = 0;
int actualWarningCount = 0;
- for (AnalysisError error in errors) {
+ for (AnalysisError error in _errors) {
if (identical(error.errorCode.errorSeverity, ErrorSeverity.ERROR)) {
actualErrorCount++;
} else {
@@ -220,6 +220,13 @@ class GatheringErrorListener implements AnalysisErrorListener {
}
/**
+ * Return the errors that were collected.
+ *
+ * @return the errors that were collected
+ */
+ List<AnalysisError> get errors => _errors;
+
+ /**
* Return the line information associated with the given source, or `null` if no line
* information has been associated with the source.
*
@@ -235,7 +242,7 @@ class GatheringErrorListener implements AnalysisErrorListener {
* @return `true` if an error with the given error code has been gathered
*/
bool hasError(ErrorCode errorCode) {
- for (AnalysisError error in errors) {
+ for (AnalysisError error in _errors) {
if (identical(error.errorCode, errorCode)) {
return true;
}
@@ -248,7 +255,7 @@ class GatheringErrorListener implements AnalysisErrorListener {
*
* @return `true` if at least one error has been gathered
*/
- bool hasErrors() => errors.length > 0;
+ bool hasErrors() => _errors.length > 0;
void onError(AnalysisError error) {
if (_rawSource != null) {
@@ -256,7 +263,7 @@ class GatheringErrorListener implements AnalysisErrorListener {
int right = left + error.length - 1;
_markedSource = "${_rawSource.substring(0, left)}^${_rawSource.substring(left, right)}^${_rawSource.substring(right)}";
}
- errors.add(error);
+ _errors.add(error);
}
/**
@@ -340,9 +347,9 @@ class GatheringErrorListener implements AnalysisErrorListener {
}
writer.newLine();
writer.print("found ");
- writer.print(errors.length);
+ writer.print(_errors.length);
writer.print(" errors:");
- for (AnalysisError error in errors) {
+ for (AnalysisError error in _errors) {
Source source = error.source;
LineInfo lineInfo = _lineInfoMap[source];
writer.newLine();
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | pkg/intl/lib/extract_messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698