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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 24197003: Support typeVariables in ClassMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments. Created 7 years, 3 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
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f508bfd47aaa92d68fda48c032ae367070e2f03d..2c0a8c981548d18e6fd2db0a86d801e6c36ac1ac 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -2088,6 +2088,21 @@ class CodeEmitterTask extends CompilerTask {
builder.addProperty("@", metadata);
}
+ if (backend.isNeededForReflection(classElement)) {
+ Link typeVars = classElement.typeVariables;
+ List properties = [];
+ for (TypeVariableType typeVar in typeVars) {
+ properties.add(js.string(typeVar.name.slowToString()));
+ properties.add(js.toExpression(reifyType(typeVar.element.bound)));
+ }
+
+ ClassElement superclass = classElement.superclass;
+ bool hasSuper = superclass != null;
+ if ((!properties.isEmpty && !hasSuper) ||
+ (hasSuper && superclass.typeVariables != typeVars)) {
+ builder.addProperty('<>', new jsAst.ArrayInitializer.from(properties));
+ }
+ }
List<CodeBuffer> classBuffers = elementBuffers[classElement];
if (classBuffers == null) {
classBuffers = [];
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698