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

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

Issue 854633004: Add option --generate-code-with-compile-time-errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42915. Created 5 years, 11 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 | « dart/pkg/compiler/lib/src/apiimpl.dart ('k') | dart/pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « dart/pkg/compiler/lib/src/apiimpl.dart ('k') | dart/pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698