| 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 ElementAst { | 5 class ElementAst { |
| 6 final Node ast; | 6 final Node ast; |
| 7 final TreeElements treeElements; | 7 final TreeElements treeElements; |
| 8 | 8 |
| 9 ElementAst(this.ast, this.treeElements); | 9 ElementAst(this.ast, this.treeElements); |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // TODO(antonm): make available from command-line options. | 86 // TODO(antonm): make available from command-line options. |
| 87 final bool outputAst = false; | 87 final bool outputAst = false; |
| 88 | 88 |
| 89 Map<Element, TreeElements> get resolvedElements => | 89 Map<Element, TreeElements> get resolvedElements => |
| 90 compiler.enqueuer.resolution.resolvedElements; | 90 compiler.enqueuer.resolution.resolvedElements; |
| 91 | 91 |
| 92 DartBackend(Compiler compiler, this.cutDeclarationTypes) | 92 DartBackend(Compiler compiler, this.cutDeclarationTypes) |
| 93 : tasks = <CompilerTask>[], | 93 : tasks = <CompilerTask>[], |
| 94 super(compiler); | 94 super(compiler); |
| 95 | 95 |
| 96 void onUseSelector(Selector selector, Enqueuer world) {} |
| 97 |
| 96 void enqueueHelpers(Enqueuer world) { | 98 void enqueueHelpers(Enqueuer world) { |
| 97 // Right now resolver doesn't always resolve interfaces needed | 99 // Right now resolver doesn't always resolve interfaces needed |
| 98 // for literals, so force them. TODO(antonm): fix in the resolver. | 100 // for literals, so force them. TODO(antonm): fix in the resolver. |
| 99 final LITERAL_TYPE_NAMES = const [ | 101 final LITERAL_TYPE_NAMES = const [ |
| 100 'Map', 'List', 'num', 'int', 'double', 'bool' | 102 'Map', 'List', 'num', 'int', 'double', 'bool' |
| 101 ]; | 103 ]; |
| 102 final coreLibrary = compiler.coreLibrary; | 104 final coreLibrary = compiler.coreLibrary; |
| 103 for (final name in LITERAL_TYPE_NAMES) { | 105 for (final name in LITERAL_TYPE_NAMES) { |
| 104 ClassElement classElement = coreLibrary.findLocal(new SourceString(name)); | 106 ClassElement classElement = coreLibrary.findLocal(new SourceString(name)); |
| 105 classElement.ensureResolved(compiler); | 107 classElement.ensureResolved(compiler); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 349 } |
| 348 | 350 |
| 349 compareElements(e0, e1) { | 351 compareElements(e0, e1) { |
| 350 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); | 352 int result = compareBy((e) => e.getLibrary().uri.toString())(e0, e1); |
| 351 if (result != 0) return result; | 353 if (result != 0) return result; |
| 352 return compareBy((e) => e.position().charOffset)(e0, e1); | 354 return compareBy((e) => e.position().charOffset)(e0, e1); |
| 353 } | 355 } |
| 354 | 356 |
| 355 List<Element> sortElements(Collection<Element> elements) => | 357 List<Element> sortElements(Collection<Element> elements) => |
| 356 sorted(elements, compareElements); | 358 sorted(elements, compareElements); |
| OLD | NEW |