| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class DartBackend extends Backend { | 5 class DartBackend extends Backend { |
| 6 final List<CompilerTask> tasks; | 6 final List<CompilerTask> tasks; |
| 7 final UnparseValidator unparseValidator; | 7 final UnparseValidator unparseValidator; |
| 8 | 8 |
| 9 Map<Element, TreeElements> get resolvedElements() => | 9 Map<Element, TreeElements> get resolvedElements() => |
| 10 compiler.enqueuer.resolution.resolvedElements; | 10 compiler.enqueuer.resolution.resolvedElements; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 new ReferencedElementCollector( | 68 new ReferencedElementCollector( |
| 69 compiler, element, treeElements, typedefs, classes) | 69 compiler, element, treeElements, typedefs, classes) |
| 70 .collect(); | 70 .collect(); |
| 71 }); | 71 }); |
| 72 final emptyTreeElements = new TreeElementMapping(); | 72 final emptyTreeElements = new TreeElementMapping(); |
| 73 collectElement(element) { collector.collect(element, emptyTreeElements); } | 73 collectElement(element) { collector.collect(element, emptyTreeElements); } |
| 74 typedefs.forEach(collectElement); | 74 typedefs.forEach(collectElement); |
| 75 classes.forEach(collectElement); | 75 classes.forEach(collectElement); |
| 76 | 76 |
| 77 ConflictingRenamer renamer = | 77 ConflictingRenamer renamer = |
| 78 new ConflictingRenamer(compiler, collector.placeholders); | 78 new ConflictingRenamer(compiler, collector); |
| 79 Emitter emitter = new Emitter(compiler, renamer); | 79 Emitter emitter = new Emitter(compiler, renamer); |
| 80 resolvedElements.forEach((element, treeElements) { | 80 resolvedElements.forEach((element, treeElements) { |
| 81 if (!shouldOutput(element)) return; | 81 if (!shouldOutput(element)) return; |
| 82 if (element.isMember()) { | 82 if (element.isMember()) { |
| 83 ClassElement enclosingClass = element.getEnclosingClass(); | 83 ClassElement enclosingClass = element.getEnclosingClass(); |
| 84 assert(enclosingClass.isClass()); | 84 assert(enclosingClass.isClass()); |
| 85 assert(enclosingClass.isTopLevel()); | 85 assert(enclosingClass.isTopLevel()); |
| 86 addMemberToClass(element, enclosingClass); | 86 addMemberToClass(element, enclosingClass); |
| 87 return; | 87 return; |
| 88 } | 88 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 typeAnnotation.visitChildren(this); | 163 typeAnnotation.visitChildren(this); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void collect() { | 166 void collect() { |
| 167 compiler.withCurrentElement(rootElement, () { | 167 compiler.withCurrentElement(rootElement, () { |
| 168 rootElement.parseNode(compiler).accept(this); | 168 rootElement.parseNode(compiler).accept(this); |
| 169 }); | 169 }); |
| 170 } | 170 } |
| 171 } | 171 } |
| OLD | NEW |