Chromium Code Reviews| 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; | 5 part of dart_backend; |
| 6 | 6 |
| 7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
| 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
| 9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
| 10 class ElementAst { | 10 class ElementAst { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 /// Initialized when dart:mirrors is loaded if the useMirrorHelperLibrary | 138 /// Initialized when dart:mirrors is loaded if the useMirrorHelperLibrary |
| 139 /// field is set. | 139 /// field is set. |
| 140 FunctionElement mirrorHelperGetNameFunction; | 140 FunctionElement mirrorHelperGetNameFunction; |
| 141 /// Initialized when dart:mirrors is loaded if the useMirrorHelperLibrary | 141 /// Initialized when dart:mirrors is loaded if the useMirrorHelperLibrary |
| 142 /// field is set. | 142 /// field is set. |
| 143 Element mirrorHelperSymbolsMap; | 143 Element mirrorHelperSymbolsMap; |
| 144 | 144 |
| 145 Map<Element, TreeElements> get resolvedElements => | 145 Map<Element, TreeElements> get resolvedElements => |
| 146 compiler.enqueuer.resolution.resolvedElements; | 146 compiler.enqueuer.resolution.resolvedElements; |
| 147 | 147 |
| 148 CodeBuffer emitCodeFor(Element e) { | |
| 149 return null; // TODO (sigurdm) Emit the code if available | |
|
ahe
2013/11/27 19:28:53
Why isn't this the default implementation?
sigurdm
2013/11/29 10:39:37
Good question
| |
| 150 } | |
| 151 | |
|
ahe
2013/11/27 19:28:53
Extra line.
sigurdm
2013/11/29 10:39:37
Done.
| |
| 152 | |
| 148 /** | 153 /** |
| 149 * Tells whether it is safe to remove type declarations from variables, | 154 * Tells whether it is safe to remove type declarations from variables, |
| 150 * functions parameters. It becomes not safe if: | 155 * functions parameters. It becomes not safe if: |
| 151 * 1) TypeError is used somewhere in the code, | 156 * 1) TypeError is used somewhere in the code, |
| 152 * 2) The code has typedefs in right hand side of IS checks, | 157 * 2) The code has typedefs in right hand side of IS checks, |
| 153 * 3) The code has classes which extend typedefs, have type arguments typedefs | 158 * 3) The code has classes which extend typedefs, have type arguments typedefs |
| 154 * or type variable bounds typedefs. | 159 * or type variable bounds typedefs. |
| 155 * These restrictions can be less strict. | 160 * These restrictions can be less strict. |
| 156 */ | 161 */ |
| 157 bool isSafeToRemoveTypeDeclarations( | 162 bool isSafeToRemoveTypeDeclarations( |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 632 } | 637 } |
| 633 | 638 |
| 634 compareElements(e0, e1) { | 639 compareElements(e0, e1) { |
| 635 int result = compareBy((e) => e.getLibrary().canonicalUri.toString())(e0, e1); | 640 int result = compareBy((e) => e.getLibrary().canonicalUri.toString())(e0, e1); |
| 636 if (result != 0) return result; | 641 if (result != 0) return result; |
| 637 return compareBy((e) => e.position().charOffset)(e0, e1); | 642 return compareBy((e) => e.position().charOffset)(e0, e1); |
| 638 } | 643 } |
| 639 | 644 |
| 640 List<Element> sortElements(Iterable<Element> elements) => | 645 List<Element> sortElements(Iterable<Element> elements) => |
| 641 sorted(elements, compareElements); | 646 sorted(elements, compareElements); |
| OLD | NEW |