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

Unified Diff: pkg/dev_compiler/lib/src/compiler/compiler.dart

Issue 2883443002: Better error when force-compile fails (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/command.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/compiler.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/compiler.dart b/pkg/dev_compiler/lib/src/compiler/compiler.dart
index 2df03f45418ccd3ef57ae741c35abb36310cd1c4..25050935e44561463f251bedc8edc80cae7d4e24 100644
--- a/pkg/dev_compiler/lib/src/compiler/compiler.dart
+++ b/pkg/dev_compiler/lib/src/compiler/compiler.dart
@@ -215,9 +215,20 @@ class ModuleCompiler {
errors.any((e) => _isFatalError(e, options))) {
return new JSModuleFile.invalid(unit.name, messages, options);
}
- var codeGenerator =
- new CodeGenerator(context, summaryData, options, _extensionTypes);
- return codeGenerator.compile(unit, trees, messages);
+
+ try {
+ var codeGenerator =
+ new CodeGenerator(context, summaryData, options, _extensionTypes);
+ return codeGenerator.compile(unit, trees, messages);
+ } catch (e) {
+ if (errors.any((e) => _isFatalError(e, options))) {
+ // Force compilation failed. Suppress the exception and report
+ // the static errors instead.
+ assert(options.unsafeForceCompile);
+ return new JSModuleFile.invalid(unit.name, messages, options);
+ }
+ rethrow;
+ }
}
}
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/command.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698