OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library elements.modelx; | 5 library elements.modelx; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show Resolution, ParsingContext; | 8 import '../common/resolution.dart' show Resolution, ParsingContext; |
9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
10 import '../constants/constant_constructors.dart'; | 10 import '../constants/constant_constructors.dart'; |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 } | 771 } |
772 } | 772 } |
773 | 773 |
774 /// Map from [Element] to the [ImportElement]s throught which it was imported. | 774 /// Map from [Element] to the [ImportElement]s throught which it was imported. |
775 /// | 775 /// |
776 /// This is used for error reporting and deferred loading. | 776 /// This is used for error reporting and deferred loading. |
777 class Importers { | 777 class Importers { |
778 Map<Element, List<ImportElement>> importers = | 778 Map<Element, List<ImportElement>> importers = |
779 new Map<Element, List<ImportElement>>(); | 779 new Map<Element, List<ImportElement>>(); |
780 | 780 |
781 /// Returns the the list of [ImportElement]s through which [element] was | 781 /// Returns the list of [ImportElement]s through which [element] was |
782 /// imported. | 782 /// imported. |
783 List<ImportElement> getImports(Element element) { | 783 List<ImportElement> getImports(Element element) { |
784 List<ImportElement> imports = importers[element]; | 784 List<ImportElement> imports = importers[element]; |
785 return imports != null ? imports : const <ImportElement>[]; | 785 return imports != null ? imports : const <ImportElement>[]; |
786 } | 786 } |
787 | 787 |
788 /// Returns the first [ImportElement] through which [element] was imported. | 788 /// Returns the first [ImportElement] through which [element] was imported. |
789 ImportElement getImport(Element element) => getImports(element).first; | 789 ImportElement getImport(Element element) => getImports(element).first; |
790 | 790 |
791 /// Register [element] as imported through [import]; | 791 /// Register [element] as imported through [import]; |
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3282 body = node.asFunctionExpression().body; | 3282 body = node.asFunctionExpression().body; |
3283 } | 3283 } |
3284 return new ParsedResolvedAst( | 3284 return new ParsedResolvedAst( |
3285 declaration, | 3285 declaration, |
3286 node, | 3286 node, |
3287 body, | 3287 body, |
3288 definingElement.treeElements, | 3288 definingElement.treeElements, |
3289 definingElement.compilationUnit.script.resourceUri); | 3289 definingElement.compilationUnit.script.resourceUri); |
3290 } | 3290 } |
3291 } | 3291 } |
OLD | NEW |