| Index: pkg/front_end/lib/src/fasta/compiler_context.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/compiler_context.dart b/pkg/front_end/lib/src/fasta/compiler_context.dart
|
| index 556ad819059e6da09bdd64219247a3be0e88fe22..040858c81ca4181fce81dd958968a743c8e42dfe 100644
|
| --- a/pkg/front_end/lib/src/fasta/compiler_context.dart
|
| +++ b/pkg/front_end/lib/src/fasta/compiler_context.dart
|
| @@ -10,6 +10,8 @@ import 'package:kernel/ast.dart' show Source;
|
|
|
| import 'compiler_command_line.dart' show CompilerCommandLine;
|
|
|
| +import 'colors.dart' show computeEnableColors;
|
| +
|
| final Object compilerContextKey = new Object();
|
|
|
| final CompilerContext rootContext =
|
| @@ -20,6 +22,8 @@ class CompilerContext {
|
|
|
| final Map<String, Source> uriToSource = <String, Source>{};
|
|
|
| + bool enableColorsCached = null;
|
| +
|
| CompilerContext(this.options);
|
|
|
| static CompilerContext get current {
|
| @@ -33,4 +37,8 @@ class CompilerContext {
|
| CompilerContext c = new CompilerContext(cl);
|
| return runZoned(() => action(c), zoneValues: {compilerContextKey: c});
|
| }
|
| +
|
| + static bool get enableColors {
|
| + return current.enableColorsCached ??= computeEnableColors(current);
|
| + }
|
| }
|
|
|