| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.generated.resolver; | 5 library analyzer.src.generated.resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 6562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6573 * Create a mapping table representing the export namespace of the given libra
ry. | 6573 * Create a mapping table representing the export namespace of the given libra
ry. |
| 6574 * | 6574 * |
| 6575 * @param library the library whose public namespace is to be created | 6575 * @param library the library whose public namespace is to be created |
| 6576 * @param visitedElements a set of libraries that do not need to be visited wh
en processing the | 6576 * @param visitedElements a set of libraries that do not need to be visited wh
en processing the |
| 6577 * export directives of the given library because all of the names de
fined by them will | 6577 * export directives of the given library because all of the names de
fined by them will |
| 6578 * be added by another library | 6578 * be added by another library |
| 6579 * @return the mapping table that was created | 6579 * @return the mapping table that was created |
| 6580 */ | 6580 */ |
| 6581 HashMap<String, Element> _createExportMapping( | 6581 HashMap<String, Element> _createExportMapping( |
| 6582 LibraryElement library, HashSet<LibraryElement> visitedElements) { | 6582 LibraryElement library, HashSet<LibraryElement> visitedElements) { |
| 6583 // Check if the export namespace has been already computed. | |
| 6584 { | |
| 6585 Namespace exportNamespace = library.exportNamespace; | |
| 6586 if (exportNamespace != null) { | |
| 6587 return exportNamespace.definedNames; | |
| 6588 } | |
| 6589 } | |
| 6590 // TODO(scheglov) Remove this after switching to the new task model. | |
| 6591 visitedElements.add(library); | 6583 visitedElements.add(library); |
| 6592 try { | 6584 try { |
| 6593 HashMap<String, Element> definedNames = new HashMap<String, Element>(); | 6585 HashMap<String, Element> definedNames = new HashMap<String, Element>(); |
| 6594 for (ExportElement element in library.exports) { | 6586 for (ExportElement element in library.exports) { |
| 6595 LibraryElement exportedLibrary = element.exportedLibrary; | 6587 LibraryElement exportedLibrary = element.exportedLibrary; |
| 6596 if (exportedLibrary != null && | 6588 if (exportedLibrary != null && |
| 6597 !visitedElements.contains(exportedLibrary)) { | 6589 !visitedElements.contains(exportedLibrary)) { |
| 6598 // | 6590 // |
| 6599 // The exported library will be null if the URI does not reference a | 6591 // The exported library will be null if the URI does not reference a |
| 6600 // valid library. | 6592 // valid library. |
| (...skipping 6190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12791 nonFields.add(node); | 12783 nonFields.add(node); |
| 12792 return null; | 12784 return null; |
| 12793 } | 12785 } |
| 12794 | 12786 |
| 12795 @override | 12787 @override |
| 12796 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 12788 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
| 12797 | 12789 |
| 12798 @override | 12790 @override |
| 12799 Object visitWithClause(WithClause node) => null; | 12791 Object visitWithClause(WithClause node) => null; |
| 12800 } | 12792 } |
| OLD | NEW |