| 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:convert' show UTF8, LineSplitter; | 9 import 'dart:convert' show UTF8, LineSplitter; |
| 10 import 'dart:io' | 10 import 'dart:io' |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 new OptionHandler('--categories=.*', setCategories), | 348 new OptionHandler('--categories=.*', setCategories), |
| 349 new OptionHandler('--disable-type-inference', implyCompilation), | 349 new OptionHandler('--disable-type-inference', implyCompilation), |
| 350 new OptionHandler('--terse', passThrough), | 350 new OptionHandler('--terse', passThrough), |
| 351 new OptionHandler('--deferred-map=.+', implyCompilation), | 351 new OptionHandler('--deferred-map=.+', implyCompilation), |
| 352 new OptionHandler('--dump-info', setDumpInfo), | 352 new OptionHandler('--dump-info', setDumpInfo), |
| 353 new OptionHandler('--disallow-unsafe-eval', | 353 new OptionHandler('--disallow-unsafe-eval', |
| 354 (_) => hasDisallowUnsafeEval = true), | 354 (_) => hasDisallowUnsafeEval = true), |
| 355 new OptionHandler('--show-package-warnings', passThrough), | 355 new OptionHandler('--show-package-warnings', passThrough), |
| 356 new OptionHandler('--csp', passThrough), | 356 new OptionHandler('--csp', passThrough), |
| 357 new OptionHandler('--enable-experimental-mirrors', passThrough), | 357 new OptionHandler('--enable-experimental-mirrors', passThrough), |
| 358 new OptionHandler('--enable-assert-message', passThrough), |
| 358 new OptionHandler('--enable-async', (_) { | 359 new OptionHandler('--enable-async', (_) { |
| 359 diagnosticHandler.info( | 360 diagnosticHandler.info( |
| 360 "Option '--enable-async' is no longer needed. " | 361 "Option '--enable-async' is no longer needed. " |
| 361 "Async-await is supported by default.", | 362 "Async-await is supported by default.", |
| 362 api.Diagnostic.HINT); | 363 api.Diagnostic.HINT); |
| 363 }), | 364 }), |
| 364 new OptionHandler('--enable-null-aware-operators', (_) { | 365 new OptionHandler('--enable-null-aware-operators', (_) { |
| 365 diagnosticHandler.info( | 366 diagnosticHandler.info( |
| 366 "Option '--enable-null-aware-operators' is no longer needed. " | 367 "Option '--enable-null-aware-operators' is no longer needed. " |
| 367 "Null aware operators are supported by default.", | 368 "Null aware operators are supported by default.", |
| 368 api.Diagnostic.HINT); | 369 api.Diagnostic.HINT); |
| 369 }), | 370 }), |
| 370 new OptionHandler('--enable-enum', (_) { | 371 new OptionHandler('--enable-enum', (_) { |
| 371 diagnosticHandler.info( | 372 diagnosticHandler.info( |
| 372 "Option '--enable-enum' is no longer needed. " | 373 "Option '--enable-enum' is no longer needed. " |
| 373 "Enums are supported by default.", | 374 "Enums are supported by default.", |
| 374 api.Diagnostic.HINT); | 375 api.Diagnostic.HINT); |
| 375 }), | 376 }), |
| 376 new OptionHandler('--allow-native-extensions', setAllowNativeExtensions), | 377 new OptionHandler('--allow-native-extensions', setAllowNativeExtensions), |
| 377 new OptionHandler('--generate-code-with-compile-time-errors', passThrough), | 378 new OptionHandler('--generate-code-with-compile-time-errors', passThrough), |
| 378 new OptionHandler('--test-mode', passThrough), | 379 new OptionHandler('--test-mode', passThrough), |
| 379 | 380 |
| 380 // The following three options must come last. | 381 // The following three options must come last. |
| 381 new OptionHandler('-D.+=.*', addInEnvironment), | 382 new OptionHandler('-D.+=.*', addInEnvironment), |
| 382 new OptionHandler('-.*', (String argument) { | 383 new OptionHandler('-.*', (String argument) { |
| 383 helpAndFail("Unknown option '$argument'."); | 384 helpAndFail("Unknown option '$argument'."); |
| 384 }), | 385 }), |
| 385 new OptionHandler('.*', (String argument) { | 386 new OptionHandler('.*', (String argument) { |
| 386 arguments.add(nativeToUriPath(argument)); | 387 arguments.add(nativeToUriPath(argument)); |
| 387 }) | 388 }), |
| 388 ]; | 389 ]; |
| 389 | 390 |
| 390 parseCommandLine(handlers, argv); | 391 parseCommandLine(handlers, argv); |
| 391 if (wantHelp || wantVersion) { | 392 if (wantHelp || wantVersion) { |
| 392 helpAndExit(wantHelp, wantVersion, diagnosticHandler.verbose); | 393 helpAndExit(wantHelp, wantVersion, diagnosticHandler.verbose); |
| 393 } | 394 } |
| 394 | 395 |
| 395 if (hasDisallowUnsafeEval) { | 396 if (hasDisallowUnsafeEval) { |
| 396 String precompiledName = | 397 String precompiledName = |
| 397 relativize(currentDirectory, | 398 relativize(currentDirectory, |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 } else if (exitCode == 253) { | 768 } else if (exitCode == 253) { |
| 768 print(">>> TEST CRASH"); | 769 print(">>> TEST CRASH"); |
| 769 } else { | 770 } else { |
| 770 print(">>> TEST FAIL"); | 771 print(">>> TEST FAIL"); |
| 771 } | 772 } |
| 772 stderr.writeln(">>> EOF STDERR"); | 773 stderr.writeln(">>> EOF STDERR"); |
| 773 subscription.resume(); | 774 subscription.resume(); |
| 774 }); | 775 }); |
| 775 }); | 776 }); |
| 776 } | 777 } |
| OLD | NEW |