Index: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
index e9d9642cdefc32c4789422ced05c525ded3d58a6..5a1ff475881794a7274c6573a4ca2a2c0cd28f91 100644 |
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart |
@@ -1504,6 +1504,25 @@ class CodeEmitterTask extends CompilerTask { |
ClassElement classElement = element; |
elements.add(backend.emitter.constantReference(constant)); |
elements.add(js(namer.isolateAccess(classElement))); |
+ |
+ // Create JavaScript Object map for by-name lookup of generative |
kasperl
2013/10/04 11:08:43
Can we avoid this if document.register isn't being
sra1
2013/10/04 20:21:28
It would be slightly more complicated than that -
|
+ // constructors. |
+ var properties = []; |
+ classElement.forEachMember( |
+ (ClassElement enclosingClass, Element member) { |
+ if (member.isGenerativeConstructor()) { |
+ properties.add( |
+ new jsAst.Property( |
+ js.string(member.name.slowToString()), |
+ new jsAst.VariableUse( |
+ backend.namer.isolateAccess(member)))); |
+ } |
+ }, |
+ includeBackendMembers: false, |
+ includeSuperAndInjectedMembers: false); |
+ |
+ var map = new jsAst.ObjectInitializer(properties); |
+ elements.add(map); |
} |
} |
} |