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

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

Issue 11448009: Represent runtime type information as nested lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years 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/constant_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
index 1b8992a0a158e5fd65054f1dd5947119949d6118..c5a85ca40257650227bea9c3424ad17011e47067 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
@@ -300,19 +300,13 @@ class ConstantInitializerEmitter implements ConstantVisitor<js.Expression> {
String helperName = backend.namer.getName(helper);
DartType type = constant.representedType;
Element element = type.element;
- String typeName;
- if (type.kind == TypeKind.INTERFACE) {
- typeName =
- backend.rti.getStringRepresentation(type, expandRawType: true);
- } else {
- assert(type.kind == TypeKind.TYPEDEF);
- typeName = element.name.slowToString();
- }
+ String name = backend.rti.getRawTypeRepresentation(type);
+ js.Expression typeName = new js.LiteralString("'$name'");
return new js.Call(
new js.PropertyAccess.field(
new js.VariableUse(namer.CURRENT_ISOLATE),
helperName),
- [new js.LiteralString("'$typeName'")]);
+ [typeName]);
}
js.Expression visitConstructed(ConstructedConstant constant) {

Powered by Google App Engine
This is Rietveld 408576698