Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| index ba51d89b47d7c917b1913646eacefaa8768d3342..6de74809281cde486211263873b7257de1179656 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
| @@ -2010,6 +2010,20 @@ class CodeEmitterTask extends CompilerTask { |
| builder.addProperty("@", metadata); |
| } |
| + if (backend.isNeededForReflection(classElement)) { |
| + List typeVars = []; |
| + for (TypeVariableType typeVar in classElement.typeVariables) { |
| + typeVars.add(js.string(typeVar.name.slowToString())); |
| + typeVars.add(js.toExpression(reifyType(typeVar.element.bound))); |
| + } |
| + |
| + var superclass = classElement.superclass; |
|
karlklose
2013/09/23 08:50:34
Please add a type annotation.
zarah
2013/09/23 11:17:02
Done.
|
| + if ((!typeVars.isEmpty && superclass == null) |
|
karlklose
2013/09/23 08:50:34
You could save the result of this check in a local
zarah
2013/09/23 11:17:02
Done.
|
| + || (superclass != null |
| + && superclass.typeVariables != classElement.typeVariables)) { |
|
karlklose
2013/09/23 08:50:34
Consider storing classElement.typeVariables in a l
zarah
2013/09/23 11:17:02
Done.
|
| + builder.addProperty('<>', new jsAst.ArrayInitializer.from(typeVars)); |
|
karlklose
2013/09/23 08:50:34
We should move the '<>' into the namer (not this C
zarah
2013/09/23 11:17:02
OK.
|
| + } |
| + } |
| List<CodeBuffer> classBuffers = elementBuffers[classElement]; |
| if (classBuffers == null) { |
| classBuffers = []; |