| 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 engine.resolver; | 5 library engine.resolver; |
| 6 | 6 |
| 7 import "dart:math" as math; | 7 import "dart:math" as math; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/utilities_collection.dart'; | 10 import 'package:analyzer/src/generated/utilities_collection.dart'; |
| (...skipping 9442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9453 * Create a mapping table representing the export namespace of the given libra
ry. | 9453 * Create a mapping table representing the export namespace of the given libra
ry. |
| 9454 * | 9454 * |
| 9455 * @param library the library whose public namespace is to be created | 9455 * @param library the library whose public namespace is to be created |
| 9456 * @param visitedElements a set of libraries that do not need to be visited wh
en processing the | 9456 * @param visitedElements a set of libraries that do not need to be visited wh
en processing the |
| 9457 * export directives of the given library because all of the names de
fined by them will | 9457 * export directives of the given library because all of the names de
fined by them will |
| 9458 * be added by another library | 9458 * be added by another library |
| 9459 * @return the mapping table that was created | 9459 * @return the mapping table that was created |
| 9460 */ | 9460 */ |
| 9461 HashMap<String, Element> _createExportMapping( | 9461 HashMap<String, Element> _createExportMapping( |
| 9462 LibraryElement library, HashSet<LibraryElement> visitedElements) { | 9462 LibraryElement library, HashSet<LibraryElement> visitedElements) { |
| 9463 // Check if the export namespace has been already computed. |
| 9464 { |
| 9465 Namespace exportNamespace = library.exportNamespace; |
| 9466 if (exportNamespace != null) { |
| 9467 return exportNamespace.definedNames; |
| 9468 } |
| 9469 } |
| 9470 // TODO(scheglov) Remove this after switching to the new task model. |
| 9463 visitedElements.add(library); | 9471 visitedElements.add(library); |
| 9464 try { | 9472 try { |
| 9465 HashMap<String, Element> definedNames = new HashMap<String, Element>(); | 9473 HashMap<String, Element> definedNames = new HashMap<String, Element>(); |
| 9466 for (ExportElement element in library.exports) { | 9474 for (ExportElement element in library.exports) { |
| 9467 LibraryElement exportedLibrary = element.exportedLibrary; | 9475 LibraryElement exportedLibrary = element.exportedLibrary; |
| 9468 if (exportedLibrary != null && | 9476 if (exportedLibrary != null && |
| 9469 !visitedElements.contains(exportedLibrary)) { | 9477 !visitedElements.contains(exportedLibrary)) { |
| 9470 // | 9478 // |
| 9471 // The exported library will be null if the URI does not reference a | 9479 // The exported library will be null if the URI does not reference a |
| 9472 // valid library. | 9480 // valid library. |
| (...skipping 5905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15378 * library. | 15386 * library. |
| 15379 */ | 15387 */ |
| 15380 final HashSet<String> members = new HashSet<String>(); | 15388 final HashSet<String> members = new HashSet<String>(); |
| 15381 | 15389 |
| 15382 /** | 15390 /** |
| 15383 * Names of resolved or unresolved class members that are read in the | 15391 * Names of resolved or unresolved class members that are read in the |
| 15384 * library. | 15392 * library. |
| 15385 */ | 15393 */ |
| 15386 final HashSet<String> readMembers = new HashSet<String>(); | 15394 final HashSet<String> readMembers = new HashSet<String>(); |
| 15387 } | 15395 } |
| OLD | NEW |