| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 return f(); | 506 return f(); |
| 507 } on SpannableAssertionFailure catch (ex, s) { | 507 } on SpannableAssertionFailure catch (ex, s) { |
| 508 if (!hasCrashed) { | 508 if (!hasCrashed) { |
| 509 String message = (ex.message != null) ? tryToString(ex.message) | 509 String message = (ex.message != null) ? tryToString(ex.message) |
| 510 : tryToString(ex); | 510 : tryToString(ex); |
| 511 SourceSpan span = spanFromSpannable(ex.node); | 511 SourceSpan span = spanFromSpannable(ex.node); |
| 512 reportError(ex.node, MessageKind.GENERIC, {'text': message}); | 512 reportError(ex.node, MessageKind.GENERIC, {'text': message}); |
| 513 pleaseReportCrash(s, 'The compiler crashed: $message.'); | 513 pleaseReportCrash(s, 'The compiler crashed: $message.'); |
| 514 } | 514 } |
| 515 hasCrashed = true; | 515 hasCrashed = true; |
| 516 throw new CompilerCancelledException('The compiler crashed.'); | 516 throw new CompilerCrashedException('The compiler crashed.'); |
| 517 } on CompilerCrashedException catch (ex) { |
| 518 rethrow; |
| 517 } on CompilerCancelledException catch (ex) { | 519 } on CompilerCancelledException catch (ex) { |
| 518 rethrow; | 520 rethrow; |
| 519 } on StackOverflowError catch (ex) { | 521 } on StackOverflowError catch (ex) { |
| 520 // We cannot report anything useful in this case, because we | 522 // We cannot report anything useful in this case, because we |
| 521 // do not have enough stack space. | 523 // do not have enough stack space. |
| 522 rethrow; | 524 rethrow; |
| 523 } catch (ex, s) { | 525 } catch (ex, s) { |
| 524 if (hasCrashed) rethrow; | 526 if (hasCrashed) rethrow; |
| 525 String message = 'The compiler crashed: ${tryToString(ex)}.'; | 527 String message = 'The compiler crashed: ${tryToString(ex)}.'; |
| 526 try { | 528 try { |
| 527 unhandledExceptionOnElement(element, s, message); | 529 unhandledExceptionOnElement(element, s, message); |
| 528 } catch (doubleFault) { | 530 } catch (doubleFault) { |
| 529 // Ignoring exceptions in exception handling. | 531 // Ignoring exceptions in exception handling. |
| 530 } | 532 } |
| 531 throw new CompilerCancelledException(message); | 533 throw new CompilerCrashedException(message); |
| 532 } finally { | 534 } finally { |
| 533 _currentElement = old; | 535 _currentElement = old; |
| 534 } | 536 } |
| 535 } | 537 } |
| 536 | 538 |
| 537 List<CompilerTask> tasks; | 539 List<CompilerTask> tasks; |
| 538 ScannerTask scanner; | 540 ScannerTask scanner; |
| 539 DietParserTask dietParser; | 541 DietParserTask dietParser; |
| 540 ParserTask parser; | 542 ParserTask parser; |
| 541 PatchParserTask patchParser; | 543 PatchParserTask patchParser; |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1656 | 1658 |
| 1657 void close() {} | 1659 void close() {} |
| 1658 | 1660 |
| 1659 toString() => name; | 1661 toString() => name; |
| 1660 | 1662 |
| 1661 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1663 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1662 static NullSink outputProvider(String name, String extension) { | 1664 static NullSink outputProvider(String name, String extension) { |
| 1663 return new NullSink('$name.$extension'); | 1665 return new NullSink('$name.$extension'); |
| 1664 } | 1666 } |
| 1665 } | 1667 } |
| OLD | NEW |