| 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 | 7 |
| 8 Map<Element, TreeElements> get resolvedElements() => | 8 Map<Element, TreeElements> get resolvedElements() => |
| 9 compiler.enqueuer.resolution.resolvedElements; | 9 compiler.enqueuer.resolution.resolvedElements; |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 void collect() { | 177 void collect() { |
| 178 compiler.withCurrentElement(rootElement, () { | 178 compiler.withCurrentElement(rootElement, () { |
| 179 rootElement.parseNode(compiler).accept(this); | 179 rootElement.parseNode(compiler).accept(this); |
| 180 }); | 180 }); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 compareBy(f) => (x, y) => f(x).compareTo(f(y)); | 184 compareBy(f) => (x, y) => f(x).compareTo(f(y)); |
| 185 | 185 |
| 186 List sorted(List l, comparison) { | 186 List sorted(Iterable l, comparison) { |
| 187 final result = new List.from(l); | 187 final result = new List.from(l); |
| 188 result.sort(comparison); | 188 result.sort(comparison); |
| 189 return result; | 189 return result; |
| 190 } | 190 } |
| 191 | 191 |
| 192 List<Element> sortElements(Collection<Element> elements) { | 192 List<Element> sortElements(Collection<Element> elements) { |
| 193 compareElements(e0, e1) { | 193 compareElements(e0, e1) { |
| 194 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); | 194 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); |
| 195 if (result != 0) return result; | 195 if (result != 0) return result; |
| 196 return compareBy((e) => e.position().charOffset)(e0, e1); | 196 return compareBy((e) => e.position().charOffset)(e0, e1); |
| 197 } | 197 } |
| 198 | 198 |
| 199 return sorted(elements, compareElements); | 199 return sorted(elements, compareElements); |
| 200 } | 200 } |
| OLD | NEW |