| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
| 9 * compiled. | 9 * compiled. |
| 10 */ | 10 */ |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 } | 747 } |
| 748 } | 748 } |
| 749 | 749 |
| 750 void log(message) { | 750 void log(message) { |
| 751 reportDiagnostic(null, message, api.Diagnostic.VERBOSE_INFO); | 751 reportDiagnostic(null, message, api.Diagnostic.VERBOSE_INFO); |
| 752 } | 752 } |
| 753 | 753 |
| 754 Future<bool> run(Uri uri) { | 754 Future<bool> run(Uri uri) { |
| 755 totalCompileTime.start(); | 755 totalCompileTime.start(); |
| 756 | 756 |
| 757 return new Future.sync(() => runCompiler(uri)).catchError((error) { | 757 return new Future.sync(() => runCompiler(uri)).catchError((error, trace) { |
| 758 if (error is CompilerCancelledException) { | 758 if (error is CompilerCancelledException) { |
| 759 log('Error: $error'); | 759 log('Error: $error'); |
| 760 return false; | 760 return false; |
| 761 } | 761 } |
| 762 | 762 |
| 763 try { | 763 try { |
| 764 if (!hasCrashed) { | 764 if (!hasCrashed) { |
| 765 hasCrashed = true; | 765 hasCrashed = true; |
| 766 reportDiagnostic(new SourceSpan(uri, 0, 0), | 766 reportDiagnostic(new SourceSpan(uri, 0, 0), |
| 767 MessageKind.COMPILER_CRASHED.error().toString(), | 767 MessageKind.COMPILER_CRASHED.error().toString(), |
| 768 api.Diagnostic.CRASH); | 768 api.Diagnostic.CRASH); |
| 769 String message = 'The compiler crashed.'; | 769 String message = 'The compiler crashed.'; |
| 770 pleaseReportCrash(getAttachedStackTrace(error), message); | 770 pleaseReportCrash(trace, message); |
| 771 } | 771 } |
| 772 } catch (doubleFault) { | 772 } catch (doubleFault) { |
| 773 // Ignoring exceptions in exception handling. | 773 // Ignoring exceptions in exception handling. |
| 774 } | 774 } |
| 775 throw error; | 775 throw error; |
| 776 }).whenComplete(() { | 776 }).whenComplete(() { |
| 777 tracer.close(); | 777 tracer.close(); |
| 778 totalCompileTime.stop(); | 778 totalCompileTime.stop(); |
| 779 }).then((_) { | 779 }).then((_) { |
| 780 return !compilationFailed; | 780 return !compilationFailed; |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1623 | 1623 |
| 1624 void close() {} | 1624 void close() {} |
| 1625 | 1625 |
| 1626 toString() => name; | 1626 toString() => name; |
| 1627 | 1627 |
| 1628 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1628 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1629 static NullSink outputProvider(String name, String extension) { | 1629 static NullSink outputProvider(String name, String extension) { |
| 1630 return new NullSink('$name.$extension'); | 1630 return new NullSink('$name.$extension'); |
| 1631 } | 1631 } |
| 1632 } | 1632 } |
| OLD | NEW |