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

Unified Diff: lib/src/compiler.dart

Issue 1840203002: More analyzer updates, and handle negative_tests (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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
Index: lib/src/compiler.dart
diff --git a/lib/src/compiler.dart b/lib/src/compiler.dart
index 8e8d7b3ad4f35bd52cff83cb9177a0b00766b787..f1747df08e702c23daa7118b3a73d58af025ddde 100644
--- a/lib/src/compiler.dart
+++ b/lib/src/compiler.dart
@@ -86,7 +86,8 @@ class BatchCompiler extends AbstractCompiler {
: super(
context,
options,
- new ErrorCollector(reporter ?? AnalysisErrorListener.NULL_LISTENER),
+ new ErrorCollector(
+ context, reporter ?? AnalysisErrorListener.NULL_LISTENER),
fileSystem) {
_inputBaseDir = options.inputBaseDir;
if (outputDir != null) {
@@ -441,23 +442,14 @@ abstract class AbstractCompiler {
List<AnalysisError> errors = errorContext.computeErrors(source);
bool failure = false;
for (var error in errors) {
- ErrorCode code = error.errorCode;
- // Always skip TODOs.
- if (code.type == ErrorType.TODO) continue;
-
- // TODO(jmesserly): for now, treat DDC errors as having a different
- // error level from Analayzer ones.
- if (isStrongModeError(code)) {
+ // TODO(jmesserly): this is a very expensive lookup, and it has to be
+ // repeated every time we want to query error severity.
+ var severity = errorSeverity(errorContext, error);
+ if (severity == ErrorSeverity.ERROR) {
reporter.onError(error);
- if (code.errorSeverity == ErrorSeverity.ERROR) {
- failure = true;
- }
- } else if (code.errorSeverity.ordinal >= ErrorSeverity.WARNING.ordinal) {
- // All analyzer warnings or errors are errors for DDC.
failure = true;
+ } else if (severity == ErrorSeverity.WARNING) {
reporter.onError(error);
- } else {
- // Skip hints for now.
}
}
return failure;

Powered by Google App Engine
This is Rietveld 408576698