| 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 part of dart_backend; | |
| 6 | |
| 7 class ElementAst { | 5 class ElementAst { |
| 8 final Node ast; | 6 final Node ast; |
| 9 final TreeElements treeElements; | 7 final TreeElements treeElements; |
| 10 | 8 |
| 11 ElementAst(this.ast, this.treeElements); | 9 ElementAst(this.ast, this.treeElements); |
| 12 | 10 |
| 13 factory ElementAst.rewrite(compiler, ast, treeElements, stripAsserts) { | 11 factory ElementAst.rewrite(compiler, ast, treeElements, stripAsserts) { |
| 14 final rewriter = | 12 final rewriter = |
| 15 new FunctionBodyRewriter(compiler, treeElements, stripAsserts); | 13 new FunctionBodyRewriter(compiler, treeElements, stripAsserts); |
| 16 return new ElementAst(rewriter.visit(ast), rewriter.cloneTreeElements); | 14 return new ElementAst(rewriter.visit(ast), rewriter.cloneTreeElements); |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 536 } |
| 539 | 537 |
| 540 compareElements(e0, e1) { | 538 compareElements(e0, e1) { |
| 541 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); | 539 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); |
| 542 if (result != 0) return result; | 540 if (result != 0) return result; |
| 543 return compareBy((e) => e.position().charOffset)(e0, e1); | 541 return compareBy((e) => e.position().charOffset)(e0, e1); |
| 544 } | 542 } |
| 545 | 543 |
| 546 List<Element> sortElements(Collection<Element> elements) => | 544 List<Element> sortElements(Collection<Element> elements) => |
| 547 sorted(elements, compareElements); | 545 sorted(elements, compareElements); |
| OLD | NEW |