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