Chromium Code Reviews| Index: lib/compiler/implementation/dart_backend/backend.dart |
| diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart |
| index ae1ef3ab787228637eb651197cf99d5f3970c1a7..b46e190217f237b4660852eab104dc3996f9cfba 100644 |
| --- a/lib/compiler/implementation/dart_backend/backend.dart |
| +++ b/lib/compiler/implementation/dart_backend/backend.dart |
| @@ -51,11 +51,10 @@ class DartBackend extends Backend { |
| Map<ClassElement, Set<Element>> classMembers = |
| new Map<ClassElement, Set<Element>>(); |
| - PlaceholderCollector collector = new PlaceholderCollector(compiler); |
| + // Build all top level elements to emit and necessary class members. |
| var newTypedefElementCallback, newClassElementCallback; |
| processElement(element, treeElements) { |
| - collector.collect(element, treeElements); |
| new ReferencedElementCollector( |
| compiler, |
| element, treeElements, |
| @@ -100,6 +99,19 @@ class DartBackend extends Backend { |
| } |
| }); |
| + // Create all necessary placeholders. |
| + PlaceholderCollector collector = new PlaceholderCollector(compiler); |
| + makePlaceholders(element) { |
| + TreeElements treeElements = resolvedElements[element]; |
| + if (treeElements === null) treeElements = emptyTreeElements; |
| + collector.collect(element, treeElements); |
| + if (element is ClassElement) { |
|
Roman
2012/08/17 08:22:28
I would prefer that class members are explicitly c
Anton Muhin
2012/08/17 08:32:41
I actually started that way, but decided eventuall
Roman
2012/08/17 08:34:24
Probably I'm wrong, but I think that some element
Anton Muhin
2012/08/17 08:38:04
Yes.
Now we go over all the member elements and p
|
| + classMembers[element].forEach(makePlaceholders); |
| + } |
| + } |
| + topLevelElements.forEach(makePlaceholders); |
| + |
| + // Create renames. |
| Map<Node, String> renames = new Map<Node, String>(); |
| Map<LibraryElement, String> imports = new Map<LibraryElement, String>(); |
| renamePlaceholders(compiler, collector, renames, imports); |