OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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.kernel.element_map; | 5 library dart2js.kernel.element_map; |
6 | 6 |
7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
8 | 8 |
9 import '../closure.dart' show BoxLocal; | 9 import '../closure.dart' show BoxLocal; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 _ensureThisAndRawType(cls, data); | 612 _ensureThisAndRawType(cls, data); |
613 return data.rawType; | 613 return data.rawType; |
614 } | 614 } |
615 | 615 |
616 FunctionType _getFunctionType(IndexedFunction function) { | 616 FunctionType _getFunctionType(IndexedFunction function) { |
617 assert(checkFamily(function)); | 617 assert(checkFamily(function)); |
618 FunctionData data = _memberData[function.memberIndex]; | 618 FunctionData data = _memberData[function.memberIndex]; |
619 return data.getFunctionType(this); | 619 return data.getFunctionType(this); |
620 } | 620 } |
621 | 621 |
| 622 DartType _getFieldType(IndexedField field) { |
| 623 assert(checkFamily(field)); |
| 624 FieldData data = _memberData[field.memberIndex]; |
| 625 return data.getFieldType(this); |
| 626 } |
| 627 |
622 ClassEntity _getAppliedMixin(IndexedClass cls) { | 628 ClassEntity _getAppliedMixin(IndexedClass cls) { |
623 assert(checkFamily(cls)); | 629 assert(checkFamily(cls)); |
624 ClassData data = _classData[cls.classIndex]; | 630 ClassData data = _classData[cls.classIndex]; |
625 _ensureSupertypes(cls, data); | 631 _ensureSupertypes(cls, data); |
626 return data.mixedInType?.element; | 632 return data.mixedInType?.element; |
627 } | 633 } |
628 | 634 |
629 bool _isMixinApplication(IndexedClass cls) { | 635 bool _isMixinApplication(IndexedClass cls) { |
630 assert(checkFamily(cls)); | 636 assert(checkFamily(cls)); |
631 ClassData data = _classData[cls.classIndex]; | 637 ClassData data = _classData[cls.classIndex]; |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 ClassEntity cls, List<DartType> typeArguments) { | 1336 ClassEntity cls, List<DartType> typeArguments) { |
1331 return new InterfaceType(cls, typeArguments); | 1337 return new InterfaceType(cls, typeArguments); |
1332 } | 1338 } |
1333 | 1339 |
1334 @override | 1340 @override |
1335 FunctionType getFunctionType(FunctionEntity function) { | 1341 FunctionType getFunctionType(FunctionEntity function) { |
1336 return elementMap._getFunctionType(function); | 1342 return elementMap._getFunctionType(function); |
1337 } | 1343 } |
1338 | 1344 |
1339 @override | 1345 @override |
| 1346 DartType getFieldType(FieldEntity field) { |
| 1347 return elementMap._getFieldType(field); |
| 1348 } |
| 1349 |
| 1350 @override |
1340 FunctionType getLocalFunctionType(covariant KLocalFunction function) { | 1351 FunctionType getLocalFunctionType(covariant KLocalFunction function) { |
1341 return function.functionType; | 1352 return function.functionType; |
1342 } | 1353 } |
1343 | 1354 |
1344 @override | 1355 @override |
1345 DartType getUnaliasedType(DartType type) => type; | 1356 DartType getUnaliasedType(DartType type) => type; |
1346 | 1357 |
1347 @override | 1358 @override |
1348 ConstructorEntity lookupConstructor(ClassEntity cls, String name, | 1359 ConstructorEntity lookupConstructor(ClassEntity cls, String name, |
1349 {bool required: false}) { | 1360 {bool required: false}) { |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 /// | 2321 /// |
2311 /// These names are not used in generated code, just as element name. | 2322 /// These names are not used in generated code, just as element name. |
2312 String _getClosureVariableName(String name, int id) { | 2323 String _getClosureVariableName(String name, int id) { |
2313 return "_captured_${name}_$id"; | 2324 return "_captured_${name}_$id"; |
2314 } | 2325 } |
2315 | 2326 |
2316 String getDeferredUri(ir.LibraryDependency node) { | 2327 String getDeferredUri(ir.LibraryDependency node) { |
2317 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); | 2328 throw new UnimplementedError('JsKernelToElementMap.getDeferredUri'); |
2318 } | 2329 } |
2319 } | 2330 } |
OLD | NEW |