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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2220 message = message(); | 2220 message = message(); |
2221 } | 2221 } |
2222 throw new SpannableAssertionFailure(spannable, message); | 2222 throw new SpannableAssertionFailure(spannable, message); |
2223 } | 2223 } |
2224 return true; | 2224 return true; |
2225 } | 2225 } |
2226 | 2226 |
2227 /// Returns `true` when [s] is private if used as an identifier. | 2227 /// Returns `true` when [s] is private if used as an identifier. |
2228 bool isPrivateName(String s) => !s.isEmpty && s.codeUnitAt(0) == $_; | 2228 bool isPrivateName(String s) => !s.isEmpty && s.codeUnitAt(0) == $_; |
2229 | 2229 |
| 2230 /// Returns `true` when [s] is public if used as an identifier. |
| 2231 bool isPublicName(String s) => !isPrivateName(s); |
| 2232 |
2230 /// A sink that drains into /dev/null. | 2233 /// A sink that drains into /dev/null. |
2231 class NullSink implements EventSink<String> { | 2234 class NullSink implements EventSink<String> { |
2232 final String name; | 2235 final String name; |
2233 | 2236 |
2234 NullSink(this.name); | 2237 NullSink(this.name); |
2235 | 2238 |
2236 add(String value) {} | 2239 add(String value) {} |
2237 | 2240 |
2238 void addError(Object error, [StackTrace stackTrace]) {} | 2241 void addError(Object error, [StackTrace stackTrace]) {} |
2239 | 2242 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2396 InterfaceType get nullType => nullClass.computeType(compiler); | 2399 InterfaceType get nullType => nullClass.computeType(compiler); |
2397 | 2400 |
2398 @override | 2401 @override |
2399 InterfaceType get numType => numClass.computeType(compiler); | 2402 InterfaceType get numType => numClass.computeType(compiler); |
2400 | 2403 |
2401 @override | 2404 @override |
2402 InterfaceType get stringType => stringClass.computeType(compiler); | 2405 InterfaceType get stringType => stringClass.computeType(compiler); |
2403 } | 2406 } |
2404 | 2407 |
2405 typedef void InternalErrorFunction(Spannable location, String message); | 2408 typedef void InternalErrorFunction(Spannable location, String message); |
OLD | NEW |