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 js_backend; | 5 part of js_backend; |
6 | 6 |
7 /// For each class, stores the possible class subtype tests that could succeed. | 7 /// For each class, stores the possible class subtype tests that could succeed. |
8 abstract class TypeChecks { | 8 abstract class TypeChecks { |
9 /// Get the set of checks required for class [element]. | 9 /// Get the set of checks required for class [element]. |
10 Iterable<ClassElement> operator[](ClassElement element); | 10 Iterable<ClassElement> operator[](ClassElement element); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 map.putIfAbsent(cls, () => new Set<ClassElement>()); | 293 map.putIfAbsent(cls, () => new Set<ClassElement>()); |
294 map[cls].add(check); | 294 map[cls].add(check); |
295 } | 295 } |
296 | 296 |
297 Iterator<ClassElement> get iterator => map.keys.iterator; | 297 Iterator<ClassElement> get iterator => map.keys.iterator; |
298 | 298 |
299 String toString() { | 299 String toString() { |
300 StringBuffer sb = new StringBuffer(); | 300 StringBuffer sb = new StringBuffer(); |
301 for (ClassElement holder in this) { | 301 for (ClassElement holder in this) { |
302 for (ClassElement check in [holder]) { | 302 for (ClassElement check in [holder]) { |
303 sb.add('${holder.name.slowToString()}.${check.name.slowToString()}, '); | 303 sb.write( |
| 304 '${holder.name.slowToString()}.${check.name.slowToString()}, '); |
304 } | 305 } |
305 } | 306 } |
306 return '[$sb]'; | 307 return '[$sb]'; |
307 } | 308 } |
308 } | 309 } |
OLD | NEW |