Index: pkg/compiler/lib/src/js_model/elements.dart |
diff --git a/pkg/compiler/lib/src/js_model/elements.dart b/pkg/compiler/lib/src/js_model/elements.dart |
index e04c1b24097b2ec84374770d9cc5592a32c40100..4de3aa76f2efbe1a4bd91d5980e511042c546c01 100644 |
--- a/pkg/compiler/lib/src/js_model/elements.dart |
+++ b/pkg/compiler/lib/src/js_model/elements.dart |
@@ -61,36 +61,8 @@ abstract class JsToFrontendMapBase implements JsToFrontendMap { |
return typeVariable; |
} |
- final Map<TypeVariableEntity, TypeVariableEntity> _toBackendTypeVariableMap = |
- <TypeVariableEntity, TypeVariableEntity>{}; |
- |
- final Map<TypeVariableEntity, TypeVariableEntity> _toFrontendTypeVariableMap = |
- <TypeVariableEntity, TypeVariableEntity>{}; |
- |
- TypeVariableEntity toBackendTypeVariable(TypeVariableEntity typeVariable) { |
- return _toBackendTypeVariableMap.putIfAbsent(typeVariable, () { |
- Entity typeDeclaration; |
- if (typeVariable.typeDeclaration is ClassEntity) { |
- typeDeclaration = toBackendClass(typeVariable.typeDeclaration); |
- } else { |
- typeDeclaration = toBackendMember(typeVariable.typeDeclaration); |
- } |
- TypeVariableEntity newTypeVariable = |
- createTypeVariable(typeDeclaration, typeVariable); |
- _toFrontendTypeVariableMap[newTypeVariable] = typeVariable; |
- return newTypeVariable; |
- }); |
- } |
- |
- TypeVariableEntity toFrontendTypeVariable(TypeVariableEntity typeVariable) { |
- return _toFrontendTypeVariableMap[typeVariable]; |
- } |
- |
- TypeVariableEntity createTypeVariable( |
- Entity typeDeclaration, TypeVariableEntity typeVariable) { |
- return new JTypeVariable( |
- typeDeclaration, typeVariable.name, typeVariable.index); |
- } |
+ TypeVariableEntity toBackendTypeVariable(TypeVariableEntity typeVariable); |
+ TypeVariableEntity toFrontendTypeVariable(TypeVariableEntity typeVariable); |
} |
class JsElementCreatorMixin { |
@@ -105,8 +77,8 @@ class JsElementCreatorMixin { |
} |
TypeVariableEntity createTypeVariable( |
- Entity typeDeclaration, String name, int index) { |
- return new JTypeVariable(typeDeclaration, name, index); |
+ int typeVariableIndex, Entity typeDeclaration, String name, int index) { |
+ return new JTypeVariable(typeVariableIndex, typeDeclaration, name, index); |
} |
IndexedConstructor createGenerativeConstructor( |
@@ -507,11 +479,13 @@ class JField extends JMember implements FieldEntity, IndexedField { |
} |
class JTypeVariable implements TypeVariableEntity, IndexedTypeVariable { |
+ final int typeVariableIndex; |
final Entity typeDeclaration; |
final String name; |
final int index; |
- JTypeVariable(this.typeDeclaration, this.name, this.index); |
+ JTypeVariable( |
+ this.typeVariableIndex, this.typeDeclaration, this.name, this.index); |
String toString() => |
'${jsElementPrefix}type_variable(${typeDeclaration.name}.$name)'; |