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 import 'dart:io' | 8 import 'dart:io' |
9 show exit, File, FileMode, Options, Platform, RandomAccessFile; | 9 show exit, File, FileMode, Options, Platform, RandomAccessFile; |
10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 .then(compilationDone); | 415 .then(compilationDone); |
416 } | 416 } |
417 | 417 |
418 class EventSinkWrapper extends EventSink<String> { | 418 class EventSinkWrapper extends EventSink<String> { |
419 var onAdd, onClose; | 419 var onAdd, onClose; |
420 | 420 |
421 EventSinkWrapper(this.onAdd, this.onClose); | 421 EventSinkWrapper(this.onAdd, this.onClose); |
422 | 422 |
423 void add(String data) => onAdd(data); | 423 void add(String data) => onAdd(data); |
424 | 424 |
425 void addError(error) => throw error; | 425 void addError(error, [StackTrace stackTrace]) => throw error; |
426 | 426 |
427 void close() => onClose(); | 427 void close() => onClose(); |
428 } | 428 } |
429 | 429 |
430 class AbortLeg { | 430 class AbortLeg { |
431 final message; | 431 final message; |
432 AbortLeg(this.message); | 432 AbortLeg(this.message); |
433 toString() => 'Aborted due to --throw-on-error: $message'; | 433 toString() => 'Aborted due to --throw-on-error: $message'; |
434 } | 434 } |
435 | 435 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } | 604 } |
605 } finally { | 605 } finally { |
606 exit(253); // 253 is recognized as a crash by our test scripts. | 606 exit(253); // 253 is recognized as a crash by our test scripts. |
607 } | 607 } |
608 }); | 608 }); |
609 } | 609 } |
610 | 610 |
611 void main() { | 611 void main() { |
612 mainWithErrorHandler(new Options()); | 612 mainWithErrorHandler(new Options()); |
613 } | 613 } |
OLD | NEW |