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

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

Issue 1581943003: Make reporter customizable (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: No changes, hopefully Created 4 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 | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/apiimpl.dart
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 8c48224f2300382f5e472d7247f80622d7bf735c..4778920ac5007806f957c47f729fbc6034bffccd 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -42,6 +42,27 @@ const String _serverPlatform = "lib/dart_server.platform";
const String _sharedPlatform = "lib/dart_shared.platform";
const String _dart2dartPlatform = "lib/dart2dart.platform";
+typedef DiagnosticOptions MakeDiagnosticOptionsFunction(
+ {bool suppressWarnings,
+ bool fatalWarnings,
+ bool suppressHints,
+ bool terseDiagnostics,
+ bool showPackageWarnings});
+
+DiagnosticOptions makeDiagnosticOptions(
+ {bool suppressWarnings: false,
+ bool fatalWarnings: false,
+ bool suppressHints: false,
+ bool terseDiagnostics: false,
+ bool showPackageWarnings: false}) {
+ return new DiagnosticOptions(
+ suppressWarnings: suppressWarnings,
+ fatalWarnings: fatalWarnings,
+ suppressHints: suppressHints,
+ terseDiagnostics: terseDiagnostics,
+ showPackageWarnings: showPackageWarnings);
+}
+
/// Implements the [Compiler] using a [api.CompilerInput] for supplying the
/// sources.
class CompilerImpl extends Compiler {
@@ -67,16 +88,20 @@ class CompilerImpl extends Compiler {
Uri get libraryRoot => platformConfigUri.resolve(".");
- CompilerImpl(this.provider,
- api.CompilerOutput outputProvider,
- this.handler,
- Uri libraryRoot,
- this.packageRoot,
- List<String> options,
- this.environment,
- [this.packageConfig,
- this.packagesDiscoveryProvider,
- Backend makeBackend(Compiler compiler)])
+ CompilerImpl(
+ this.provider,
+ api.CompilerOutput outputProvider,
+ this.handler,
+ Uri libraryRoot,
+ this.packageRoot,
+ List<String> options,
+ this.environment,
+ [this.packageConfig,
+ this.packagesDiscoveryProvider,
+ MakeBackendFuncion makeBackend,
Johnni Winther 2016/01/21 08:52:58 MakeBackendFuncion -> MakeBackendFuncion
ahe 2016/01/22 11:04:49 What would be the point of that :-P
ahe 2016/01/22 11:58:22 Fixed in CL 1617183003.
+ MakeReporterFunction makeReporter,
+ MakeDiagnosticOptionsFunction makeDiagnosticOptionsFunction =
+ makeDiagnosticOptions])
: this.options = options,
this.platformConfigUri = resolvePlatformConfig(libraryRoot, options),
super(
@@ -121,7 +146,7 @@ class CompilerImpl extends Compiler {
hasIncrementalSupport:
forceIncrementalSupport ||
hasOption(options, Flags.incrementalSupport),
- diagnosticOptions: new DiagnosticOptions(
+ diagnosticOptions: makeDiagnosticOptions(
suppressWarnings: hasOption(options, Flags.suppressWarnings),
fatalWarnings: hasOption(options, Flags.fatalWarnings),
suppressHints: hasOption(options, Flags.suppressHints),
@@ -137,7 +162,8 @@ class CompilerImpl extends Compiler {
testMode: hasOption(options, Flags.testMode),
allowNativeExtensions:
hasOption(options, Flags.allowNativeExtensions),
- makeBackend: makeBackend) {
+ makeBackend: makeBackend,
+ makeReporter: makeReporter) {
tasks.addAll([
userHandlerTask = new GenericTask('Diagnostic handler', this),
userProviderTask = new GenericTask('Input provider', this),
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698