Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart |
| index b28becfe0f946d38a49401ce62826448e2d284d6..5e35a422c4815dcf247bd7ece6c575c1f31519c5 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart |
| @@ -301,14 +301,24 @@ class ClassEmitter extends CodeEmitterHelper { |
| } |
| if (backend.isNeededForReflection(classElement)) { |
| - Link typeVars = classElement.typeVariables; |
| + bool sameList(List a, List b) { |
|
Johnni Winther
2014/02/26 14:01:54
Put this in util.dart and reuse in dart_types.dart
karlklose
2014/02/27 09:31:41
Done.
|
| + if (a.length != b.length) return false; |
| + for (int index = 0; index < a.length; index++) { |
| + if (a[index] != b[index]) { |
| + return false; |
| + } |
| + } |
| + return true; |
| + } |
| + |
| + List<DartType> typeVars = classElement.typeVariables; |
| Iterable typeVariableProperties = task.typeVariableHandler |
| .typeVariablesOf(classElement).map(js.toExpression); |
| ClassElement superclass = classElement.superclass; |
| bool hasSuper = superclass != null; |
| if ((!typeVariableProperties.isEmpty && !hasSuper) || |
| - (hasSuper && superclass.typeVariables != typeVars)) { |
| + (hasSuper && !sameList(superclass.typeVariables, typeVars))) { |
| classBuilder.addProperty('<>', |
| new jsAst.ArrayInitializer.from(typeVariableProperties)); |
| } |