Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/colors.dart |
| diff --git a/pkg/front_end/lib/src/fasta/colors.dart b/pkg/front_end/lib/src/fasta/colors.dart |
| index f3891b917d50387f3ccdc2b196cefd395f55e936..3d4a4323e6b6eb2e8dd02cccf863fe79dc9f9c96 100644 |
| --- a/pkg/front_end/lib/src/fasta/colors.dart |
| +++ b/pkg/front_end/lib/src/fasta/colors.dart |
| @@ -98,7 +98,13 @@ String white(String string) => wrap(string, WHITE_COLOR); |
| /// Note: do not call this method directly, as it is expensive to |
| /// compute. Instead, use [CompilerContext.enableColors]. |
| bool computeEnableColors(CompilerContext context) { |
| - if (!Platform.ansiSupported) { |
| + bool ansiSupported; |
|
karlklose
2017/03/16 13:01:47
Initialize with 'false'?
ahe
2017/03/16 13:11:09
I have to distinguish between three cases:
* We k
|
| + try { |
| + ansiSupported = Platform.ansiSupported; |
| + } catch (e) { |
|
karlklose
2017/03/16 13:01:47
Could you be more specific about the exception typ
ahe
2017/03/16 13:11:10
Done.
|
| + // Ignored. |
|
karlklose
2017/03/16 13:01:46
Maybe add something like: 'the getter is not suppo
ahe
2017/03/16 13:11:09
Done.
|
| + } |
| + if (ansiSupported == false) { |
| if (context.options.verbose) { |
| print("Not enabling colors, 'Platform.ansiSupported' is false."); |
| } |
| @@ -119,7 +125,7 @@ bool computeEnableColors(CompilerContext context) { |
| return false; |
| } |
| - if (Platform.isWindows) { |
| + if (ansiSupported == true && Platform.isWindows) { |
| if (context.options.verbose) { |
| print("Enabling colors as OS is Windows."); |
| } |