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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 if (condition is Function){ | 1100 if (condition is Function){ |
1101 condition = condition(); | 1101 condition = condition(); |
1102 } | 1102 } |
1103 if (spannable == null || !condition) { | 1103 if (spannable == null || !condition) { |
1104 throw new SpannableAssertionFailure(spannable, message); | 1104 throw new SpannableAssertionFailure(spannable, message); |
1105 } | 1105 } |
1106 return true; | 1106 return true; |
1107 } | 1107 } |
1108 | 1108 |
1109 /// A sink that drains into /dev/null. | 1109 /// A sink that drains into /dev/null. |
1110 class NullSink extends Sink<String> { | 1110 class NullSink extends StreamSink<String> { |
1111 final String name; | 1111 final String name; |
1112 | 1112 |
1113 NullSink(this.name); | 1113 NullSink(this.name); |
1114 | 1114 |
1115 add(String value) {} | 1115 add(String value) {} |
1116 | 1116 |
| 1117 void signalError(AsyncError error) {} |
| 1118 |
1117 void close() {} | 1119 void close() {} |
1118 | 1120 |
1119 toString() => name; | 1121 toString() => name; |
1120 | 1122 |
1121 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1123 /// Convenience method for getting an [api.CompilerOutputProvider]. |
1122 static NullSink outputProvider(String name, String extension) { | 1124 static NullSink outputProvider(String name, String extension) { |
1123 return new NullSink('$name.$extension'); | 1125 return new NullSink('$name.$extension'); |
1124 } | 1126 } |
1125 } | 1127 } |
OLD | NEW |