| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.cmdline; | 5 library dart2js.cmdline; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink, Future; | 7 import 'dart:async' show EventSink, Future; |
| 8 import 'dart:convert' show UTF8, LineSplitter; | 8 import 'dart:convert' show UTF8, LineSplitter; |
| 9 import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr; | 9 import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr; |
| 10 | 10 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 diagnosticHandler.showWarnings = false; | 311 diagnosticHandler.showWarnings = false; |
| 312 passThrough(Flags.suppressWarnings); | 312 passThrough(Flags.suppressWarnings); |
| 313 }), | 313 }), |
| 314 new OptionHandler(Flags.fatalWarnings, passThrough), | 314 new OptionHandler(Flags.fatalWarnings, passThrough), |
| 315 new OptionHandler( | 315 new OptionHandler( |
| 316 Flags.suppressHints, (_) => diagnosticHandler.showHints = false), | 316 Flags.suppressHints, (_) => diagnosticHandler.showHints = false), |
| 317 // TODO(sigmund): remove entirely after Dart 1.20 | 317 // TODO(sigmund): remove entirely after Dart 1.20 |
| 318 new OptionHandler( | 318 new OptionHandler( |
| 319 '--output-type=dart|--output-type=dart-multi|--output-type=js', | 319 '--output-type=dart|--output-type=dart-multi|--output-type=js', |
| 320 setOutputType), | 320 setOutputType), |
| 321 new OptionHandler(Flags.useCpsIr, passThrough), | |
| 322 new OptionHandler(Flags.noFrequencyBasedMinification, passThrough), | 321 new OptionHandler(Flags.noFrequencyBasedMinification, passThrough), |
| 323 new OptionHandler(Flags.verbose, setVerbose), | 322 new OptionHandler(Flags.verbose, setVerbose), |
| 324 new OptionHandler(Flags.version, (_) => wantVersion = true), | 323 new OptionHandler(Flags.version, (_) => wantVersion = true), |
| 325 new OptionHandler('--library-root=.+', setLibraryRoot), | 324 new OptionHandler('--library-root=.+', setLibraryRoot), |
| 326 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), | 325 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), |
| 327 new OptionHandler(Flags.allowMockCompilation, passThrough), | 326 new OptionHandler(Flags.allowMockCompilation, passThrough), |
| 328 new OptionHandler(Flags.fastStartup, passThrough), | 327 new OptionHandler(Flags.fastStartup, passThrough), |
| 329 new OptionHandler(Flags.genericMethodSyntax, passThrough), | 328 new OptionHandler(Flags.genericMethodSyntax, passThrough), |
| 330 new OptionHandler(Flags.initializingFormalAccess, passThrough), | 329 new OptionHandler(Flags.initializingFormalAccess, passThrough), |
| 331 new OptionHandler('${Flags.minify}|-m', implyCompilation), | 330 new OptionHandler('${Flags.minify}|-m', implyCompilation), |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 | 678 |
| 680 --dump-info | 679 --dump-info |
| 681 Generates an out.info.json file with information about the generated code. | 680 Generates an out.info.json file with information about the generated code. |
| 682 You can inspect the generated file with the viewer at: | 681 You can inspect the generated file with the viewer at: |
| 683 https://dart-lang.github.io/dump-info-visualizer/ | 682 https://dart-lang.github.io/dump-info-visualizer/ |
| 684 | 683 |
| 685 --generate-code-with-compile-time-errors | 684 --generate-code-with-compile-time-errors |
| 686 Generates output even if the program contains compile-time errors. Use the | 685 Generates output even if the program contains compile-time errors. Use the |
| 687 exit code to determine if compilation failed. | 686 exit code to determine if compilation failed. |
| 688 | 687 |
| 689 --use-cps-ir | |
| 690 Experimental. Use the new CPS based backend for code generation. | |
| 691 | |
| 692 --no-frequency-based-minification | 688 --no-frequency-based-minification |
| 693 Experimental. Disabled the new frequency based minifying namer and use the | 689 Experimental. Disabled the new frequency based minifying namer and use the |
| 694 old namer instead. | 690 old namer instead. |
| 695 ''' | 691 ''' |
| 696 .trim()); | 692 .trim()); |
| 697 } | 693 } |
| 698 | 694 |
| 699 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { | 695 void helpAndExit(bool wantHelp, bool wantVersion, bool verbose) { |
| 700 if (wantVersion) { | 696 if (wantVersion) { |
| 701 var version = (BUILD_ID == null) ? '<non-SDK build>' : BUILD_ID; | 697 var version = (BUILD_ID == null) ? '<non-SDK build>' : BUILD_ID; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 @override | 991 @override |
| 996 void close() { | 992 void close() { |
| 997 // Do nothing. | 993 // Do nothing. |
| 998 } | 994 } |
| 999 | 995 |
| 1000 @override | 996 @override |
| 1001 void addError(errorEvent, [StackTrace stackTrace]) { | 997 void addError(errorEvent, [StackTrace stackTrace]) { |
| 1002 // Ignore | 998 // Ignore |
| 1003 } | 999 } |
| 1004 } | 1000 } |
| OLD | NEW |