| Index: pkg/dev_compiler/lib/src/compiler/command.dart
|
| diff --git a/pkg/dev_compiler/lib/src/compiler/command.dart b/pkg/dev_compiler/lib/src/compiler/command.dart
|
| index cd340db8154888a41ab01eb7940eb3a228509f73..af34e95f711c3490304d9cd70cff1f4cfdcaa5f6 100644
|
| --- a/pkg/dev_compiler/lib/src/compiler/command.dart
|
| +++ b/pkg/dev_compiler/lib/src/compiler/command.dart
|
| @@ -186,7 +186,11 @@ void _compile(ArgResults argResults, AnalyzerOptions analyzerOptions,
|
| var module = compiler.compile(unit, compilerOpts);
|
| module.errors.forEach(printFn);
|
|
|
| - if (!module.isValid) throw new CompileErrorException();
|
| + if (!module.isValid) {
|
| + throw compilerOpts.unsafeForceCompile
|
| + ? new ForceCompileErrorException()
|
| + : new CompileErrorException();
|
| + }
|
|
|
| // Write JS file, as well as source map and summary (if requested).
|
| for (var i = 0; i < outPaths.length; i++) {
|
| @@ -262,3 +266,9 @@ void _usageException(String message) {
|
| class CompileErrorException implements Exception {
|
| toString() => '\nPlease fix all errors before compiling (warnings are okay).';
|
| }
|
| +
|
| +/// Thrown when force compilation failed (probably due to static errors).
|
| +class ForceCompileErrorException extends CompileErrorException {
|
| + toString() =>
|
| + '\nForce-compilation not successful. Please check static errors.';
|
| +}
|
|
|