| 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.world_builder; | 5 library dart2js.kernel.world_builder; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/backend_api.dart'; | 10 import '../common/backend_api.dart'; |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 bool isSubtype(DartType a, DartType b) { | 574 bool isSubtype(DartType a, DartType b) { |
| 575 throw new UnimplementedError('KernelElementEnvironment.isSubtype'); | 575 throw new UnimplementedError('KernelElementEnvironment.isSubtype'); |
| 576 } | 576 } |
| 577 | 577 |
| 578 @override | 578 @override |
| 579 FunctionType getFunctionType(KFunction function) { | 579 FunctionType getFunctionType(KFunction function) { |
| 580 throw new UnimplementedError('KernelElementEnvironment.getFunctionType'); | 580 throw new UnimplementedError('KernelElementEnvironment.getFunctionType'); |
| 581 } | 581 } |
| 582 | 582 |
| 583 @override | 583 @override |
| 584 FunctionType getLocalFunctionType(Local function) { |
| 585 throw new UnimplementedError( |
| 586 'KernelElementEnvironment.getLocalFunctionType'); |
| 587 } |
| 588 |
| 589 @override |
| 590 DartType getUnaliasedType(DartType type) => type; |
| 591 |
| 592 @override |
| 584 ConstructorEntity lookupConstructor(ClassEntity cls, String name, | 593 ConstructorEntity lookupConstructor(ClassEntity cls, String name, |
| 585 {bool required: false}) { | 594 {bool required: false}) { |
| 586 ConstructorEntity constructor = worldBuilder.lookupConstructor(cls, name); | 595 ConstructorEntity constructor = worldBuilder.lookupConstructor(cls, name); |
| 587 if (constructor == null && required) { | 596 if (constructor == null && required) { |
| 588 throw new SpannableAssertionFailure(CURRENT_ELEMENT_SPANNABLE, | 597 throw new SpannableAssertionFailure(CURRENT_ELEMENT_SPANNABLE, |
| 589 "The constructor $name was not found in class '${cls.name}'."); | 598 "The constructor $name was not found in class '${cls.name}'."); |
| 590 } | 599 } |
| 591 return constructor; | 600 return constructor; |
| 592 } | 601 } |
| 593 | 602 |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 } | 907 } |
| 899 | 908 |
| 900 InterfaceType getMixinTypeForClass(KClass cls) { | 909 InterfaceType getMixinTypeForClass(KClass cls) { |
| 901 KClassEnv env = builder._classEnvs[cls.classIndex]; | 910 KClassEnv env = builder._classEnvs[cls.classIndex]; |
| 902 ir.Supertype mixedInType = env.cls.mixedInType; | 911 ir.Supertype mixedInType = env.cls.mixedInType; |
| 903 if (mixedInType == null) return null; | 912 if (mixedInType == null) return null; |
| 904 return builder.createInterfaceType( | 913 return builder.createInterfaceType( |
| 905 mixedInType.classNode, mixedInType.typeArguments); | 914 mixedInType.classNode, mixedInType.typeArguments); |
| 906 } | 915 } |
| 907 } | 916 } |
| OLD | NEW |