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

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

Issue 27689002: Reapply "Add TypeVariable object on runtime to support reflection on type variables." and … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix: include classes with members needed for reflection. Created 7 years, 2 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_backend/runtime_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
index 8f927714b836b9d3e88793d91d5f836fd2d4e70c..029bd8dc061a56b7be098b461f6fd3f11c3d0f18 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -485,7 +485,7 @@ class RuntimeTypes {
int index = 0;
for (; !types.isEmpty; types = types.tail, index++) {
jsAst.Expression representation =
- _getTypeRepresentation(types.head, onVariable);
+ getTypeRepresentation(types.head, onVariable);
elements.add(new jsAst.ArrayElement(index, representation));
}
return new jsAst.ArrayInitializer(index, elements);
@@ -497,7 +497,7 @@ class RuntimeTypes {
jsAst.Expression onVariable(TypeVariableType v) {
return new jsAst.VariableUse(v.name.slowToString());
};
- jsAst.Expression encoding = _getTypeRepresentation(type, onVariable);
+ jsAst.Expression encoding = getTypeRepresentation(type, onVariable);
if (contextClass == null && !alwaysGenerateFunction) {
return encoding;
} else {
@@ -529,18 +529,19 @@ class RuntimeTypes {
}
}
- String getTypeRepresentation(DartType type, OnVariableCallback onVariable) {
+ String getTypeRepresentationWithHashes(DartType type,
+ OnVariableCallback onVariable) {
// Create a type representation. For type variables call the original
// callback for side effects and return a template placeholder.
- jsAst.Expression representation = _getTypeRepresentation(type, (variable) {
+ jsAst.Expression representation = getTypeRepresentation(type, (variable) {
onVariable(variable);
return new jsAst.LiteralString('#');
});
return jsAst.prettyPrint(representation, compiler).buffer.toString();
}
- jsAst.Expression _getTypeRepresentation(DartType type,
- OnVariableCallback onVariable) {
+ jsAst.Expression getTypeRepresentation(DartType type,
+ OnVariableCallback onVariable) {
return representationGenerator.getTypeRepresentation(type, onVariable);
}

Powered by Google App Engine
This is Rietveld 408576698