| 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 Future; | 7 import 'dart:async' show 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 '--output-type=dart|--output-type=dart-multi|--output-type=js', | 311 '--output-type=dart|--output-type=dart-multi|--output-type=js', |
| 312 setOutputType), | 312 setOutputType), |
| 313 new OptionHandler(Flags.useCpsIr, passThrough), | 313 new OptionHandler(Flags.useCpsIr, passThrough), |
| 314 new OptionHandler(Flags.noFrequencyBasedMinification, passThrough), | 314 new OptionHandler(Flags.noFrequencyBasedMinification, passThrough), |
| 315 new OptionHandler(Flags.verbose, setVerbose), | 315 new OptionHandler(Flags.verbose, setVerbose), |
| 316 new OptionHandler(Flags.version, (_) => wantVersion = true), | 316 new OptionHandler(Flags.version, (_) => wantVersion = true), |
| 317 new OptionHandler('--library-root=.+', setLibraryRoot), | 317 new OptionHandler('--library-root=.+', setLibraryRoot), |
| 318 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), | 318 new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true), |
| 319 new OptionHandler(Flags.allowMockCompilation, passThrough), | 319 new OptionHandler(Flags.allowMockCompilation, passThrough), |
| 320 new OptionHandler(Flags.fastStartup, passThrough), | 320 new OptionHandler(Flags.fastStartup, passThrough), |
| 321 new OptionHandler(Flags.conditionalDirectives, passThrough), | |
| 322 new OptionHandler(Flags.genericMethodSyntax, passThrough), | 321 new OptionHandler(Flags.genericMethodSyntax, passThrough), |
| 323 new OptionHandler('${Flags.minify}|-m', implyCompilation), | 322 new OptionHandler('${Flags.minify}|-m', implyCompilation), |
| 324 new OptionHandler(Flags.preserveUris, passThrough), | 323 new OptionHandler(Flags.preserveUris, passThrough), |
| 325 new OptionHandler('--force-strip=.*', setStrip), | 324 new OptionHandler('--force-strip=.*', setStrip), |
| 326 new OptionHandler(Flags.disableDiagnosticColors, | 325 new OptionHandler(Flags.disableDiagnosticColors, |
| 327 (_) => diagnosticHandler.enableColors = false), | 326 (_) => diagnosticHandler.enableColors = false), |
| 328 new OptionHandler(Flags.enableDiagnosticColors, | 327 new OptionHandler(Flags.enableDiagnosticColors, |
| 329 (_) => diagnosticHandler.enableColors = true), | 328 (_) => diagnosticHandler.enableColors = true), |
| 330 new OptionHandler('--enable[_-]checked[_-]mode|--checked', | 329 new OptionHandler('--enable[_-]checked[_-]mode|--checked', |
| 331 (_) => setCheckedMode(Flags.enableCheckedMode)), | 330 (_) => setCheckedMode(Flags.enableCheckedMode)), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 349 new OptionHandler(Flags.disableTypeInference, implyCompilation), | 348 new OptionHandler(Flags.disableTypeInference, implyCompilation), |
| 350 new OptionHandler(Flags.terse, passThrough), | 349 new OptionHandler(Flags.terse, passThrough), |
| 351 new OptionHandler('--deferred-map=.+', implyCompilation), | 350 new OptionHandler('--deferred-map=.+', implyCompilation), |
| 352 new OptionHandler(Flags.dumpInfo, setDumpInfo), | 351 new OptionHandler(Flags.dumpInfo, setDumpInfo), |
| 353 new OptionHandler( | 352 new OptionHandler( |
| 354 '--disallow-unsafe-eval', (_) => hasDisallowUnsafeEval = true), | 353 '--disallow-unsafe-eval', (_) => hasDisallowUnsafeEval = true), |
| 355 new OptionHandler(Option.showPackageWarnings, passThrough), | 354 new OptionHandler(Option.showPackageWarnings, passThrough), |
| 356 new OptionHandler(Flags.useContentSecurityPolicy, passThrough), | 355 new OptionHandler(Flags.useContentSecurityPolicy, passThrough), |
| 357 new OptionHandler(Flags.enableExperimentalMirrors, passThrough), | 356 new OptionHandler(Flags.enableExperimentalMirrors, passThrough), |
| 358 new OptionHandler(Flags.enableAssertMessage, passThrough), | 357 new OptionHandler(Flags.enableAssertMessage, passThrough), |
| 358 // TODO(floitsch): remove conditional directives flag. |
| 359 // We don't provide the info-message yet, since we haven't publicly |
| 360 // launched the feature yet. |
| 361 new OptionHandler(Flags.conditionalDirectives, (_) {}), |
| 359 new OptionHandler('--enable-async', (_) { | 362 new OptionHandler('--enable-async', (_) { |
| 360 diagnosticHandler.info( | 363 diagnosticHandler.info( |
| 361 "Option '--enable-async' is no longer needed. " | 364 "Option '--enable-async' is no longer needed. " |
| 362 "Async-await is supported by default.", | 365 "Async-await is supported by default.", |
| 363 api.Diagnostic.HINT); | 366 api.Diagnostic.HINT); |
| 364 }), | 367 }), |
| 365 new OptionHandler('--enable-null-aware-operators', (_) { | 368 new OptionHandler('--enable-null-aware-operators', (_) { |
| 366 diagnosticHandler.info( | 369 diagnosticHandler.info( |
| 367 "Option '--enable-null-aware-operators' is no longer needed. " | 370 "Option '--enable-null-aware-operators' is no longer needed. " |
| 368 "Null aware operators are supported by default.", | 371 "Null aware operators are supported by default.", |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } else if (exitCode == 253) { | 777 } else if (exitCode == 253) { |
| 775 print(">>> TEST CRASH"); | 778 print(">>> TEST CRASH"); |
| 776 } else { | 779 } else { |
| 777 print(">>> TEST FAIL"); | 780 print(">>> TEST FAIL"); |
| 778 } | 781 } |
| 779 stderr.writeln(">>> EOF STDERR"); | 782 stderr.writeln(">>> EOF STDERR"); |
| 780 subscription.resume(); | 783 subscription.resume(); |
| 781 }); | 784 }); |
| 782 }); | 785 }); |
| 783 } | 786 } |
| OLD | NEW |