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

Unified Diff: client/fling/src/java/core/com/google/dart/CompileService.java

Issue 8447006: Fling: Fix bit rot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: total Created 9 years, 1 month 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: client/fling/src/java/core/com/google/dart/CompileService.java
diff --git a/client/fling/src/java/core/com/google/dart/CompileService.java b/client/fling/src/java/core/com/google/dart/CompileService.java
index 8a7a78f5b5efc656d83156b60689530a69956daf..64003aeed418f2bdde4f0da423602712c15016c4 100644
--- a/client/fling/src/java/core/com/google/dart/CompileService.java
+++ b/client/fling/src/java/core/com/google/dart/CompileService.java
@@ -23,6 +23,7 @@ import com.google.dart.compiler.DartCompilationError;
import com.google.dart.compiler.DartCompiler;
import com.google.dart.compiler.DartCompilerListener;
import com.google.dart.compiler.DefaultCompilerConfiguration;
+import com.google.dart.compiler.ErrorSeverity;
import com.google.dart.compiler.LibrarySource;
import com.google.dart.compiler.Source;
import com.google.dart.compiler.UrlLibrarySource;
@@ -124,27 +125,17 @@ public class CompileService {
*/
private static class Listener extends DartCompilerListener {
- private final List<CompileError> fatalErrors = Lists.newArrayList();
-
- private final List<CompileError> typeErrors = Lists.newArrayList();
+ private final List<CompileError> errors = Lists.newArrayList();
private final List<CompileError> warnings = Lists.newArrayList();
@Override
public void onError(DartCompilationError error) {
- fatalErrors.add(CompileError.from(error));
- }
-
- public void compilationError(DartCompilationError error) {
- fatalErrors.add(CompileError.from(error));
- }
-
- public void compilationWarning(DartCompilationError error) {
- warnings.add(CompileError.from(error));
- }
-
- public void typeError(DartCompilationError error) {
- typeErrors.add(CompileError.from(error));
+ if (error.getErrorCode().getErrorSeverity() == ErrorSeverity.ERROR) {
+ errors.add(CompileError.from(error));
+ } else {
+ warnings.add(CompileError.from(error));
+ }
}
@Override
@@ -279,13 +270,11 @@ public class CompileService {
artifacts,
listener);
return new CompileResult(artifacts.getJavaScriptFor(source),
- listener.fatalErrors,
- listener.typeErrors,
+ listener.errors,
listener.warnings,
System.currentTimeMillis() - startedAt);
} catch (Throwable e) {
- return new CompileResult(listener.fatalErrors,
- listener.typeErrors,
+ return new CompileResult(listener.errors,
listener.warnings,
e,
System.currentTimeMillis() - startedAt);

Powered by Google App Engine
This is Rietveld 408576698