Index: dart/pkg/compiler/lib/src/compiler.dart |
diff --git a/dart/pkg/compiler/lib/src/compiler.dart b/dart/pkg/compiler/lib/src/compiler.dart |
index f4351b986a104565b405a52c18114db80db67a73..0c4590a0c3278e9ece63f6f6f37816e15640e870 100644 |
--- a/dart/pkg/compiler/lib/src/compiler.dart |
+++ b/dart/pkg/compiler/lib/src/compiler.dart |
@@ -744,7 +744,11 @@ abstract class Compiler implements DiagnosticListener { |
/// If `true` native extension syntax is supported by the frontend. |
final bool allowNativeExtensions; |
- api.CompilerOutputProvider outputProvider; |
+ /// Output provider from user of Compiler API. |
+ api.CompilerOutputProvider userOutputProvider; |
+ |
+ /// Generate output even when there are compile-time errors. |
+ final bool generateCodeWithCompileTimeErrors; |
bool disableInlining = false; |
@@ -998,6 +1002,7 @@ abstract class Compiler implements DiagnosticListener { |
this.enableAsyncAwait: false, |
this.enableEnums: false, |
this.allowNativeExtensions: false, |
+ this.generateCodeWithCompileTimeErrors: false, |
api.CompilerOutputProvider outputProvider, |
List<String> strips: const []}) |
: this.disableTypeInferenceFlag = |
@@ -1008,7 +1013,7 @@ abstract class Compiler implements DiagnosticListener { |
this.analyzeAllFlag = analyzeAllFlag, |
this.hasIncrementalSupport = hasIncrementalSupport, |
cacheStrategy = new CacheStrategy(hasIncrementalSupport), |
- this.outputProvider = (outputProvider == null) |
+ this.userOutputProvider = (outputProvider == null) |
? NullSink.outputProvider |
: outputProvider { |
if (hasIncrementalSupport) { |
@@ -2090,6 +2095,11 @@ abstract class Compiler implements DiagnosticListener { |
bool elementHasCompileTimeError(Element element) { |
return elementsWithCompileTimeErrors.contains(element); |
} |
+ |
+ EventSink<String> outputProvider(String name, String extension) { |
+ if (compilationFailed) return new NullSink('$name.$extension'); |
+ return userOutputProvider(name, extension); |
+ } |
} |
class CompilerTask { |