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

Unified Diff: utils/kernel-service/kernel-service.dart

Issue 2982093003: Unifying compiler context (Closed)
Patch Set: revert change to kernel-service.dart Created 3 years, 5 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: utils/kernel-service/kernel-service.dart
diff --git a/utils/kernel-service/kernel-service.dart b/utils/kernel-service/kernel-service.dart
index 5b7ca5031c378a729bd9740d5777ef6e21fe4d27..e10eb8c50ff7632746601f1717226b067d99c7f7 100644
--- a/utils/kernel-service/kernel-service.dart
+++ b/utils/kernel-service/kernel-service.dart
@@ -78,12 +78,22 @@ Future _processLoadRequest(request) async {
..packagesFileUri = packagesUri
..sdkSummary = sdkSummary
..verbose = verbose
- ..onError = (CompilationError e) => errors.add(e.message);
+ ..throwOnErrors = false
+ ..reportMessages = true
+ ..onError = (CompilationMessage e) {
+ if (e.severity == Severity.error) {
+ // TODO(sigmund): support emitting code with errors as long as they are
+ // handled in the generated code (issue #30194).
+ errors.add(e.message);
+ }
+ };
CompilationResult result;
try {
Program program = await kernelForProgram(script, options);
if (errors.isNotEmpty) {
+ // TODO(sigmund): the compiler prints errors to the console, so we
+ // shouldn't print those messages again here.
result = new CompilationResult.errors(errors);
} else {
// We serialize the program excluding platform.dill because the VM has

Powered by Google App Engine
This is Rietveld 408576698