| 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/resolution.dart'; | 10 import '../common/resolution.dart'; |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 for (ir.VariableDeclaration variable in sortedNamedParameters) { | 449 for (ir.VariableDeclaration variable in sortedNamedParameters) { |
| 450 namedParameters.add(variable.name); | 450 namedParameters.add(variable.name); |
| 451 namedParameterTypes.add(getDartType(variable.type)); | 451 namedParameterTypes.add(getDartType(variable.type)); |
| 452 } | 452 } |
| 453 return new FunctionType(returnType, parameterTypes, optionalParameterTypes, | 453 return new FunctionType(returnType, parameterTypes, optionalParameterTypes, |
| 454 namedParameters, namedParameterTypes); | 454 namedParameters, namedParameterTypes); |
| 455 } | 455 } |
| 456 | 456 |
| 457 LibraryEntity getLibrary(ir.Library node) => _getLibrary(node); | 457 LibraryEntity getLibrary(ir.Library node) => _getLibrary(node); |
| 458 | 458 |
| 459 ir.Library getKernelLibrary(KLibrary entity) => |
| 460 _libraryEnvs[entity.libraryIndex].library; |
| 461 |
| 462 ir.Class getKernelClass(KClass entity) => _classEnvs[entity.classIndex].cls; |
| 463 |
| 459 @override | 464 @override |
| 460 Local getLocalFunction(ir.TreeNode node) => _getLocal(node); | 465 Local getLocalFunction(ir.TreeNode node) => _getLocal(node); |
| 461 | 466 |
| 462 @override | 467 @override |
| 463 ClassEntity getClass(ir.Class node) => _getClass(node); | 468 ClassEntity getClass(ir.Class node) => _getClass(node); |
| 464 | 469 |
| 465 @override | 470 @override |
| 466 FieldEntity getField(ir.Field node) => _getField(node); | 471 FieldEntity getField(ir.Field node) => _getField(node); |
| 467 | 472 |
| 468 TypeVariableEntity getTypeVariable(ir.TypeParameter node) => | 473 TypeVariableEntity getTypeVariable(ir.TypeParameter node) => |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 } | 1006 } |
| 1002 | 1007 |
| 1003 InterfaceType getMixinTypeForClass(KClass cls) { | 1008 InterfaceType getMixinTypeForClass(KClass cls) { |
| 1004 KClassEnv env = builder._classEnvs[cls.classIndex]; | 1009 KClassEnv env = builder._classEnvs[cls.classIndex]; |
| 1005 ir.Supertype mixedInType = env.cls.mixedInType; | 1010 ir.Supertype mixedInType = env.cls.mixedInType; |
| 1006 if (mixedInType == null) return null; | 1011 if (mixedInType == null) return null; |
| 1007 return builder.createInterfaceType( | 1012 return builder.createInterfaceType( |
| 1008 mixedInType.classNode, mixedInType.typeArguments); | 1013 mixedInType.classNode, mixedInType.typeArguments); |
| 1009 } | 1014 } |
| 1010 } | 1015 } |
| OLD | NEW |