Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3036)

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart

Issue 177963002: Use List instead of Link in the type system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}

Powered by Google App Engine
This is Rietveld 408576698