| Index: pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| index 80f846e6382d6df059ca5ef8c1768907c4f43d8f..0aac780e54fb4fb313354d4bd19905dc7ced2520 100644
|
| --- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| +++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
|
| @@ -10,6 +10,7 @@ import 'package:analyzer/src/dart/element/type.dart';
|
| import 'package:analyzer/src/generated/resolver.dart';
|
| import 'package:analyzer/src/generated/utilities_dart.dart';
|
| import 'package:analyzer/src/summary/format.dart';
|
| +import 'package:analyzer/src/summary/name_filter.dart';
|
|
|
| /**
|
| * Serialize all the elements in [lib] to a summary using [ctx] as the context
|
| @@ -282,31 +283,15 @@ class _LibrarySerializer {
|
| }
|
| import.importedLibrary.exportNamespace.definedNames
|
| .forEach((String name, Element e) {
|
| - if (import.combinators.any((NamespaceCombinator combinator) =>
|
| - doesCombinatorReject(combinator, name))) {
|
| - return;
|
| + if (new NameFilter.forNamespaceCombinators(import.combinators)
|
| + .accepts(name)) {
|
| + prefixMap[e] = import.prefix;
|
| }
|
| - prefixMap[e] = import.prefix;
|
| });
|
| }
|
| }
|
|
|
| /**
|
| - * Determine if the given [combinator] would reject an element having the
|
| - * given [name].
|
| - */
|
| - bool doesCombinatorReject(NamespaceCombinator combinator, String name) {
|
| - if (combinator is ShowElementCombinator) {
|
| - return !combinator.shownNames.contains(name);
|
| - } else if (combinator is HideElementCombinator) {
|
| - return combinator.hiddenNames.contains(name);
|
| - } else {
|
| - throw new StateError(
|
| - 'Unexpected combinator type ${combinator.runtimeType}');
|
| - }
|
| - }
|
| -
|
| - /**
|
| * Compute the appropriate De Bruijn index to represent the given type
|
| * parameter [type].
|
| */
|
| @@ -727,8 +712,7 @@ class _LibrarySerializer {
|
| if (unresolvedReferenceIndex == null) {
|
| assert(unlinkedReferences.length == prelinkedReferences.length);
|
| unresolvedReferenceIndex = unlinkedReferences.length;
|
| - unlinkedReferences
|
| - .add(encodeUnlinkedReference(name: '*unresolved*'));
|
| + unlinkedReferences.add(encodeUnlinkedReference(name: '*unresolved*'));
|
| prelinkedReferences.add(
|
| encodePrelinkedReference(kind: PrelinkedReferenceKind.unresolved));
|
| }
|
|
|