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 // TODO(sigmund): rename and move to common/elements.dart | 5 // TODO(sigmund): rename and move to common/elements.dart |
6 library dart2js.type_system; | 6 library dart2js.type_system; |
7 | 7 |
| 8 import 'common.dart'; |
8 import 'common/names.dart' show Identifiers, Uris; | 9 import 'common/names.dart' show Identifiers, Uris; |
9 import 'constants/values.dart'; | 10 import 'constants/values.dart'; |
10 import 'elements/entities.dart'; | 11 import 'elements/entities.dart'; |
11 import 'elements/names.dart' show PublicName; | 12 import 'elements/names.dart' show PublicName; |
12 import 'elements/types.dart'; | 13 import 'elements/types.dart'; |
13 import 'js_backend/backend.dart' show JavaScriptBackend; | 14 import 'js_backend/backend.dart' show JavaScriptBackend; |
14 import 'js_backend/constant_system_javascript.dart'; | 15 import 'js_backend/constant_system_javascript.dart'; |
15 import 'universe/call_structure.dart' show CallStructure; | 16 import 'universe/call_structure.dart' show CallStructure; |
16 import 'universe/selector.dart' show Selector; | 17 import 'universe/selector.dart' show Selector; |
17 import 'universe/call_structure.dart'; | 18 import 'universe/call_structure.dart'; |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 | 1155 |
1155 ClassEntity get expectTrustTypeAnnotationsClass { | 1156 ClassEntity get expectTrustTypeAnnotationsClass { |
1156 _ensureExpectAnnotations(); | 1157 _ensureExpectAnnotations(); |
1157 return _expectTrustTypeAnnotationsClass; | 1158 return _expectTrustTypeAnnotationsClass; |
1158 } | 1159 } |
1159 | 1160 |
1160 ClassEntity get expectAssumeDynamicClass { | 1161 ClassEntity get expectAssumeDynamicClass { |
1161 _ensureExpectAnnotations(); | 1162 _ensureExpectAnnotations(); |
1162 return _expectAssumeDynamicClass; | 1163 return _expectAssumeDynamicClass; |
1163 } | 1164 } |
| 1165 |
| 1166 /// Returns `true` if the implementation of the 'operator ==' [function] is |
| 1167 /// known to handle `null` as argument. |
| 1168 bool operatorEqHandlesNullArgument(FunctionEntity function) { |
| 1169 assert(function.name == '==', |
| 1170 failedAt(function, "Unexpected function $function.")); |
| 1171 ClassEntity cls = function.enclosingClass; |
| 1172 return cls == objectClass || |
| 1173 cls == jsInterceptorClass || |
| 1174 cls == jsNullClass; |
| 1175 } |
1164 } | 1176 } |
1165 | 1177 |
1166 /// Interface for accessing libraries, classes and members. | 1178 /// Interface for accessing libraries, classes and members. |
1167 /// | 1179 /// |
1168 /// The element environment makes private and injected members directly | 1180 /// The element environment makes private and injected members directly |
1169 /// available and should therefore not be used to determine scopes. | 1181 /// available and should therefore not be used to determine scopes. |
1170 /// | 1182 /// |
1171 /// The properties exposed are Dart-centric and should therefore, long-term, not | 1183 /// The properties exposed are Dart-centric and should therefore, long-term, not |
1172 /// be used during codegen, expect for mirrors. | 1184 /// be used during codegen, expect for mirrors. |
1173 // TODO(johnniwinther): Split this into an element environment and a type query | 1185 // TODO(johnniwinther): Split this into an element environment and a type query |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 // TODO(johnniwinther): Remove this when the resolver is removed. | 1322 // TODO(johnniwinther): Remove this when the resolver is removed. |
1311 DartType getUnaliasedType(DartType type); | 1323 DartType getUnaliasedType(DartType type); |
1312 | 1324 |
1313 /// Returns `true` if [member] a the synthetic getter `loadLibrary` injected | 1325 /// Returns `true` if [member] a the synthetic getter `loadLibrary` injected |
1314 /// on deferred libraries. | 1326 /// on deferred libraries. |
1315 bool isDeferredLoadLibraryGetter(MemberEntity member); | 1327 bool isDeferredLoadLibraryGetter(MemberEntity member); |
1316 | 1328 |
1317 /// Returns the metadata constants declared on [member]. | 1329 /// Returns the metadata constants declared on [member]. |
1318 Iterable<ConstantValue> getMemberMetadata(MemberEntity member); | 1330 Iterable<ConstantValue> getMemberMetadata(MemberEntity member); |
1319 } | 1331 } |
OLD | NEW |