OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js.js_emitter.type_test_registry; | 5 library dart2js.js_emitter.type_test_registry; |
6 | 6 |
7 import '../elements/resolution_types.dart' | 7 import '../elements/resolution_types.dart' |
8 show | 8 show |
9 ResolutionDartType, | 9 ResolutionDartType, |
10 ResolutionFunctionType, | 10 ResolutionFunctionType, |
11 ResolutionInterfaceType, | 11 ResolutionInterfaceType, |
12 Types, | 12 Types, |
13 ResolutionTypeVariableType; | 13 ResolutionTypeVariableType; |
14 import '../elements/elements.dart' | 14 import '../elements/elements.dart' |
15 show ClassElement, Element, ElementKind, MemberElement, MethodElement; | 15 show ClassElement, Element, ElementKind, MemberElement, MethodElement; |
16 import '../js_backend/js_backend.dart' | 16 import '../js_backend/js_backend.dart' |
17 show JavaScriptBackend, RuntimeTypesSubstitutions, TypeChecks; | 17 show JavaScriptBackend, RuntimeTypesSubstitutions, TypeChecks; |
18 import '../universe/world_builder.dart'; | 18 import '../universe/world_builder.dart'; |
19 import '../world.dart' show ClosedWorld; | 19 import '../world.dart' show ClosedWorld; |
20 | 20 |
21 class TypeTestRegistry { | 21 class TypeTestRegistry { |
22 /** | 22 /** |
23 * Raw ClassElement symbols occuring in is-checks and type assertions. If the | 23 * Raw ClassElement symbols occurring in is-checks and type assertions. If th
e |
24 * program contains parameterized checks `x is Set<int>` and | 24 * program contains parameterized checks `x is Set<int>` and |
25 * `x is Set<String>` then the ClassElement `Set` will occur once in | 25 * `x is Set<String>` then the ClassElement `Set` will occur once in |
26 * [checkedClasses]. | 26 * [checkedClasses]. |
27 */ | 27 */ |
28 Set<ClassElement> checkedClasses; | 28 Set<ClassElement> checkedClasses; |
29 | 29 |
30 /** | 30 /** |
31 * The set of function types that checked, both explicity through tests of | 31 * The set of function types that checked, both explicity through tests of |
32 * typedefs and implicitly through type annotations in checked mode. | 32 * typedefs and implicitly through type annotations in checked mode. |
33 */ | 33 */ |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 checkedFunctionTypes = new Set<ResolutionFunctionType>(); | 167 checkedFunctionTypes = new Set<ResolutionFunctionType>(); |
168 _codegenWorldBuilder.isChecks.forEach((ResolutionDartType t) { | 168 _codegenWorldBuilder.isChecks.forEach((ResolutionDartType t) { |
169 if (t is ResolutionInterfaceType) { | 169 if (t is ResolutionInterfaceType) { |
170 checkedClasses.add(t.element); | 170 checkedClasses.add(t.element); |
171 } else if (t is ResolutionFunctionType) { | 171 } else if (t is ResolutionFunctionType) { |
172 checkedFunctionTypes.add(t); | 172 checkedFunctionTypes.add(t); |
173 } | 173 } |
174 }); | 174 }); |
175 } | 175 } |
176 } | 176 } |
OLD | NEW |