Chromium Code Reviews| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 | 147 |
| 148 Element get currentElement => _currentElement; | 148 Element get currentElement => _currentElement; |
| 149 withCurrentElement(Element element, f()) { | 149 withCurrentElement(Element element, f()) { |
| 150 Element old = currentElement; | 150 Element old = currentElement; |
| 151 _currentElement = element; | 151 _currentElement = element; |
| 152 try { | 152 try { |
| 153 return f(); | 153 return f(); |
| 154 } on SpannableAssertionFailure catch (ex) { | 154 } on SpannableAssertionFailure catch (ex) { |
| 155 if (!hasCrashed) { | 155 if (!hasCrashed) { |
| 156 SourceSpan span = spanFromSpannable(ex.node); | 156 SourceSpan span = spanFromSpannable(ex.node); |
| 157 reportDiagnostic(span, ex.message, api.Diagnostic.ERROR); | 157 reportDiagnostic(span, ex.message, api.Diagnostic.INFO); |
|
ahe
2012/11/30 15:44:07
Let's find another way to solve this.
Johnni Winther
2012/12/04 10:07:17
Done.
| |
| 158 } | 158 } |
| 159 hasCrashed = true; | 159 hasCrashed = true; |
| 160 throw; | 160 throw; |
| 161 } on CompilerCancelledException catch (ex) { | 161 } on CompilerCancelledException catch (ex) { |
| 162 throw; | 162 throw; |
| 163 } on StackOverflowError catch (ex) { | 163 } on StackOverflowError catch (ex) { |
| 164 // We cannot report anything useful in this case, because we | 164 // We cannot report anything useful in this case, because we |
| 165 // do not have enough stack space. | 165 // do not have enough stack space. |
| 166 throw; | 166 throw; |
| 167 } catch (ex) { | 167 } catch (ex) { |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 944 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 944 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
| 945 // information on assertion errors. | 945 // information on assertion errors. |
| 946 if (condition is Function){ | 946 if (condition is Function){ |
| 947 condition = condition(); | 947 condition = condition(); |
| 948 } | 948 } |
| 949 if (spannable == null || !condition) { | 949 if (spannable == null || !condition) { |
| 950 throw new SpannableAssertionFailure(spannable, message); | 950 throw new SpannableAssertionFailure(spannable, message); |
| 951 } | 951 } |
| 952 return true; | 952 return true; |
| 953 } | 953 } |
| OLD | NEW |