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 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2216 message = message(); | 2216 message = message(); |
2217 } | 2217 } |
2218 throw new SpannableAssertionFailure(spannable, message); | 2218 throw new SpannableAssertionFailure(spannable, message); |
2219 } | 2219 } |
2220 return true; | 2220 return true; |
2221 } | 2221 } |
2222 | 2222 |
2223 /// Returns `true` when [s] is private if used as an identifier. | 2223 /// Returns `true` when [s] is private if used as an identifier. |
2224 bool isPrivateName(String s) => !s.isEmpty && s.codeUnitAt(0) == $_; | 2224 bool isPrivateName(String s) => !s.isEmpty && s.codeUnitAt(0) == $_; |
2225 | 2225 |
| 2226 /// Returns `true` when [s] is public if used as an identifier. |
| 2227 bool isPublicName(String s) => !isPrivateName(s); |
| 2228 |
2226 /// A sink that drains into /dev/null. | 2229 /// A sink that drains into /dev/null. |
2227 class NullSink implements EventSink<String> { | 2230 class NullSink implements EventSink<String> { |
2228 final String name; | 2231 final String name; |
2229 | 2232 |
2230 NullSink(this.name); | 2233 NullSink(this.name); |
2231 | 2234 |
2232 add(String value) {} | 2235 add(String value) {} |
2233 | 2236 |
2234 void addError(Object error, [StackTrace stackTrace]) {} | 2237 void addError(Object error, [StackTrace stackTrace]) {} |
2235 | 2238 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2408 return futureClass.computeType(compiler).createInstantiation([elementType]); | 2411 return futureClass.computeType(compiler).createInstantiation([elementType]); |
2409 } | 2412 } |
2410 | 2413 |
2411 @override | 2414 @override |
2412 InterfaceType streamType([DartType elementType = const DynamicType()]) { | 2415 InterfaceType streamType([DartType elementType = const DynamicType()]) { |
2413 return streamClass.computeType(compiler).createInstantiation([elementType]); | 2416 return streamClass.computeType(compiler).createInstantiation([elementType]); |
2414 } | 2417 } |
2415 } | 2418 } |
2416 | 2419 |
2417 typedef void InternalErrorFunction(Spannable location, String message); | 2420 typedef void InternalErrorFunction(Spannable location, String message); |
OLD | NEW |