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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 if (uri.scheme != 'file') { | 495 if (uri.scheme != 'file') { |
496 fail('Unhandled scheme ${uri.scheme}.'); | 496 fail('Unhandled scheme ${uri.scheme}.'); |
497 } | 497 } |
498 var file = new File(uri.toFilePath()).openSync(mode: FileMode.WRITE); | 498 var file = new File(uri.toFilePath()).openSync(mode: FileMode.WRITE); |
499 file.writeStringSync(text); | 499 file.writeStringSync(text); |
500 file.closeSync(); | 500 file.closeSync(); |
501 } | 501 } |
502 | 502 |
503 void fail(String message) { | 503 void fail(String message) { |
504 if (diagnosticHandler != null) { | 504 if (diagnosticHandler != null) { |
505 diagnosticHandler.diagnosticHandler( | 505 diagnosticHandler.report( |
506 null, -1, -1, message, api.Diagnostic.ERROR); | 506 null, -1, -1, message, api.Diagnostic.ERROR); |
507 } else { | 507 } else { |
508 print('Error: $message'); | 508 print('Error: $message'); |
509 } | 509 } |
510 exitFunc(1); | 510 exitFunc(1); |
511 } | 511 } |
512 | 512 |
513 Future<api.CompilationResult> compilerMain(List<String> arguments) { | 513 Future<api.CompilationResult> compilerMain(List<String> arguments) { |
514 var root = uriPathToNative("/$LIBRARY_ROOT"); | 514 var root = uriPathToNative("/$LIBRARY_ROOT"); |
515 arguments = <String>['--library-root=${Platform.script.toFilePath()}$root'] | 515 arguments = <String>['--library-root=${Platform.script.toFilePath()}$root'] |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 } else if (exitCode == 253) { | 765 } else if (exitCode == 253) { |
766 print(">>> TEST CRASH"); | 766 print(">>> TEST CRASH"); |
767 } else { | 767 } else { |
768 print(">>> TEST FAIL"); | 768 print(">>> TEST FAIL"); |
769 } | 769 } |
770 stderr.writeln(">>> EOF STDERR"); | 770 stderr.writeln(">>> EOF STDERR"); |
771 subscription.resume(); | 771 subscription.resume(); |
772 }); | 772 }); |
773 }); | 773 }); |
774 } | 774 } |
OLD | NEW |