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 implements Iterable<ClassElement> { | 8 abstract class TypeChecks implements Iterable<ClassElement> { |
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Iterable<ClassElement> operator[](ClassElement element) { | 160 Iterable<ClassElement> operator[](ClassElement element) { |
161 Set<ClassElement> result = map[element]; | 161 Set<ClassElement> result = map[element]; |
162 return result != null ? result : const <ClassElement>[]; | 162 return result != null ? result : const <ClassElement>[]; |
163 } | 163 } |
164 | 164 |
165 void add(ClassElement cls, ClassElement check) { | 165 void add(ClassElement cls, ClassElement check) { |
166 map.putIfAbsent(cls, () => new Set<ClassElement>()); | 166 map.putIfAbsent(cls, () => new Set<ClassElement>()); |
167 map[cls].add(check); | 167 map[cls].add(check); |
168 } | 168 } |
169 | 169 |
170 Iterator<ClassElement> iterator() => map.keys.iterator(); | 170 Iterator<ClassElement> get iterator => map.keys.iterator; |
171 } | 171 } |
OLD | NEW |