Skip to content

Commit 29268c6

Browse files
davidmorganCommit Queue
authored and
Commit Queue
committed
[dart2js] Remove trailing whitespace and newline from error message.
Before: ``` dart compile js --wrong-flag Compile Dart to JavaScript. Usage: dart compile js [arguments] <dart entry point> -h, --help Print this usage information. -h -v Show detailed information about all options. -o, --output Write the output to <file name>. -O<0,1,2,3,4> Set the compiler optimization level (defaults to -O1). -O0 No optimizations (only meant for debugging the compiler). -O1 Default (includes whole program analyses and inlining). -O2 Safe production-oriented optimizations (like minification). -O3 Potentially unsafe optimizations (see -h -v for details). -O4 More agressive unsafe optimizations (see -h -v for details). <-- TWO SPACES HERE and a newline Error: Unknown option '--wrong-flag'. ``` After this change: ``` dart compile js --wrong-flag Compile Dart to JavaScript. Usage: dart compile js [arguments] <dart entry point> -h, --help Print this usage information. -h -v Show detailed information about all options. -o, --output Write the output to <file name>. -O<0,1,2,3,4> Set the compiler optimization level (defaults to -O1). -O0 No optimizations (only meant for debugging the compiler). -O1 Default (includes whole program analyses and inlining). -O2 Safe production-oriented optimizations (like minification). -O3 Potentially unsafe optimizations (see -h -v for details). -O4 More agressive unsafe optimizations (see -h -v for details). Error: Unknown option '--wrong-flag'. ``` [email protected] Change-Id: Ie0541d830b53e3e81b4b02a20988cbd41db64325 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339300 Auto-Submit: Morgan :) <[email protected]> Reviewed-by: Stephen Adams <[email protected]> Commit-Queue: Morgan :) <[email protected]>
1 parent 38e5af5 commit 29268c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/compiler/lib/src/dart2js.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import 'package:front_end/src/api_unstable/dart2js.dart' as fe;
1414
import '../compiler_api.dart' as api;
1515
import 'commandline_options.dart';
1616
import 'common/ram_usage.dart';
17+
import 'compiler.dart' as defaultCompiler show Compiler;
1718
import 'io/mapped_file.dart';
1819
import 'options.dart' show CompilerOptions, Dart2JSStage, FeatureOptions;
19-
import 'compiler.dart' as defaultCompiler show Compiler;
2020
import 'source_file_provider.dart';
2121
import 'util/command_line.dart';
2222
import 'util/util.dart' show stackTraceFilePrefix;
@@ -982,7 +982,8 @@ Usage: dart compile js [arguments] <dart entry point>
982982
-O2 Safe production-oriented optimizations (like minification).
983983
-O3 Potentially unsafe optimizations (see -h -v for details).
984984
-O4 More agressive unsafe optimizations (see -h -v for details).
985-
''');
985+
'''
986+
.trim());
986987
}
987988

988989
void verboseHelp() {

0 commit comments

Comments
 (0)