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

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

Issue 22692002: Implement reflecting on mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor bug fixes during testing. Created 7 years, 4 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: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 02a8b4c0c4f37d36bcd0705cb71ada21574fe96e..8946f13ef186f88eb125730b74ef08e4d69f2f6b 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -1371,6 +1371,10 @@ class CodeEmitterTask extends CompilerTask {
Element element = elementOrSelector;
if (element.isGenerativeConstructorBody()) {
return null;
+ } else if (element.isClass()) {
+ ClassElement cls = element;
+ if (cls.isUnnamedMixinApplication) return null;
+ return cls.name.slowToString();
}
throw compiler.internalErrorOnElement(
element, 'Do not know how to reflect on this $element');
@@ -1981,8 +1985,8 @@ class CodeEmitterTask extends CompilerTask {
buffer.write('$className:$_');
buffer.write(jsAst.prettyPrint(builder.toObjectInitializer(), compiler));
if (backend.shouldRetainName(classElement.name)) {
- buffer.write(',$n$n"+${classElement.name.slowToString()}": 0');
- recordedMangledNames.add(className);
+ String reflectionName = getReflectionName(classElement, className);
+ buffer.write(',$n$n"+$reflectionName": 0');
}
}

Powered by Google App Engine
This is Rietveld 408576698