| 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' | 7 import 'dart:async' |
| 8 show Future, EventSink; | 8 show Future, EventSink; |
| 9 import 'dart:io' | 9 import 'dart:io' |
| 10 show exit, File, FileMode, Platform, RandomAccessFile, FileSystemException; | 10 show exit, File, FileMode, Platform, RandomAccessFile, FileSystemException; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 new OptionHandler('--analyze-only', setAnalyzeOnly), | 290 new OptionHandler('--analyze-only', setAnalyzeOnly), |
| 291 new OptionHandler('--analyze-signatures-only', setAnalyzeOnly), | 291 new OptionHandler('--analyze-signatures-only', setAnalyzeOnly), |
| 292 new OptionHandler('--disable-native-live-type-analysis', passThrough), | 292 new OptionHandler('--disable-native-live-type-analysis', passThrough), |
| 293 new OptionHandler('--categories=.*', setCategories), | 293 new OptionHandler('--categories=.*', setCategories), |
| 294 new OptionHandler('--disable-type-inference', implyCompilation), | 294 new OptionHandler('--disable-type-inference', implyCompilation), |
| 295 new OptionHandler('--terse', passThrough), | 295 new OptionHandler('--terse', passThrough), |
| 296 new OptionHandler('--dump-info', implyCompilation), | 296 new OptionHandler('--dump-info', implyCompilation), |
| 297 new OptionHandler('--disallow-unsafe-eval', | 297 new OptionHandler('--disallow-unsafe-eval', |
| 298 (_) => hasDisallowUnsafeEval = true), | 298 (_) => hasDisallowUnsafeEval = true), |
| 299 new OptionHandler('--show-package-warnings', passThrough), | 299 new OptionHandler('--show-package-warnings', passThrough), |
| 300 new OptionHandler('--csp', passThrough), |
| 300 new OptionHandler('-D.+=.*', addInEnvironment), | 301 new OptionHandler('-D.+=.*', addInEnvironment), |
| 301 | 302 |
| 302 // The following two options must come last. | 303 // The following two options must come last. |
| 303 new OptionHandler('-.*', (String argument) { | 304 new OptionHandler('-.*', (String argument) { |
| 304 helpAndFail("Unknown option '$argument'."); | 305 helpAndFail("Unknown option '$argument'."); |
| 305 }), | 306 }), |
| 306 new OptionHandler('.*', (String argument) { | 307 new OptionHandler('.*', (String argument) { |
| 307 arguments.add(nativeToUriPath(argument)); | 308 arguments.add(nativeToUriPath(argument)); |
| 308 }) | 309 }) |
| 309 ]; | 310 ]; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 --enable-diagnostic-colors | 569 --enable-diagnostic-colors |
| 569 Add colors to diagnostic messages. | 570 Add colors to diagnostic messages. |
| 570 | 571 |
| 571 --terse | 572 --terse |
| 572 Emit diagnostics without suggestions for how to get rid of the diagnosed | 573 Emit diagnostics without suggestions for how to get rid of the diagnosed |
| 573 problems. | 574 problems. |
| 574 | 575 |
| 575 --show-package-warnings | 576 --show-package-warnings |
| 576 Show warnings and hints generated from packages. | 577 Show warnings and hints generated from packages. |
| 577 | 578 |
| 579 --csp |
| 580 Disables dynamic generation of code in the generated output. This is |
| 581 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). |
| 582 |
| 578 The following options are only used for compiler development and may | 583 The following options are only used for compiler development and may |
| 579 be removed in a future version: | 584 be removed in a future version: |
| 580 | 585 |
| 581 --output-type=dart | 586 --output-type=dart |
| 582 Output Dart code instead of JavaScript. | 587 Output Dart code instead of JavaScript. |
| 583 | 588 |
| 584 --throw-on-error | 589 --throw-on-error |
| 585 Throw an exception if a compile-time error is detected. | 590 Throw an exception if a compile-time error is detected. |
| 586 | 591 |
| 587 --library-root=<directory> | 592 --library-root=<directory> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 } | 661 } |
| 657 } | 662 } |
| 658 | 663 |
| 659 try { | 664 try { |
| 660 return compilerMain(arguments).catchError(onError); | 665 return compilerMain(arguments).catchError(onError); |
| 661 } catch (exception, trace) { | 666 } catch (exception, trace) { |
| 662 onError(exception, trace); | 667 onError(exception, trace); |
| 663 return new Future.value(); | 668 return new Future.value(); |
| 664 } | 669 } |
| 665 } | 670 } |
| OLD | NEW |