Skip to content

Commit d3f37ab

Browse files
fshcheglovCommit Queue
authored and
Commit Queue
committed
Removed LibraryOrAugmentationScope.
These two classes were not used. Change-Id: Ie656abf81c3a001efb76158f41466a111c8638e0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380966 Commit-Queue: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 569e9b1 commit d3f37ab

File tree

1 file changed

+0
-94
lines changed

1 file changed

+0
-94
lines changed

pkg/analyzer/lib/src/dart/element/scope.dart

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -302,72 +302,6 @@ class LibraryFragmentScope implements Scope {
302302
}
303303
}
304304

305-
class LibraryOrAugmentationScope extends EnclosedScope {
306-
final LibraryOrAugmentationElementImpl _container;
307-
List<ExtensionElement> extensions = [];
308-
309-
factory LibraryOrAugmentationScope(
310-
LibraryOrAugmentationElementImpl container,
311-
) {
312-
var importScope = _LibraryOrAugmentationImportScope(container);
313-
return LibraryOrAugmentationScope._(container, importScope);
314-
}
315-
316-
LibraryOrAugmentationScope._(
317-
this._container,
318-
_LibraryOrAugmentationImportScope importScope,
319-
) : super(importScope) {
320-
extensions.addAll(importScope.extensions);
321-
322-
for (var prefix in _container.prefixes) {
323-
if (!prefix.isWildcardVariable) {
324-
_addGetter(prefix);
325-
}
326-
}
327-
_container.library.units.forEach(_addUnitElements);
328-
329-
// Add implicit 'dart:core' declarations.
330-
if ('${_container.source.uri}' == 'dart:core') {
331-
_addGetter(DynamicElementImpl.instance);
332-
_addGetter(NeverElementImpl.instance);
333-
}
334-
335-
extensions = extensions.toFixedList();
336-
}
337-
338-
void _addExtension(ExtensionElement element) {
339-
if (element.isAugmentation) {
340-
return;
341-
}
342-
343-
_addGetter(element);
344-
if (!extensions.contains(element)) {
345-
extensions.add(element);
346-
}
347-
}
348-
349-
void _addUnitElements(CompilationUnitElement compilationUnit) {
350-
for (var element in compilationUnit.accessors) {
351-
if (element.augmentation == null) {
352-
_addPropertyAccessor(element);
353-
}
354-
}
355-
356-
for (var element in compilationUnit.functions) {
357-
if (element.augmentation == null) {
358-
_addGetter(element);
359-
}
360-
}
361-
362-
compilationUnit.enums.forEach(_addGetter);
363-
compilationUnit.extensions.forEach(_addExtension);
364-
compilationUnit.extensionTypes.forEach(_addGetter);
365-
compilationUnit.typeAliases.forEach(_addGetter);
366-
compilationUnit.mixins.forEach(_addGetter);
367-
compilationUnit.classes.forEach(_addGetter);
368-
}
369-
}
370-
371305
class LocalScope extends EnclosedScope {
372306
LocalScope(super.parent);
373307

@@ -646,31 +580,3 @@ mixin _GettersAndSetters {
646580
}
647581
}
648582
}
649-
650-
class _LibraryOrAugmentationImportScope implements Scope {
651-
final LibraryOrAugmentationElementImpl _container;
652-
final PrefixScope _nullPrefixScope;
653-
List<ExtensionElement>? _extensions;
654-
655-
_LibraryOrAugmentationImportScope(LibraryOrAugmentationElementImpl container)
656-
: _container = container,
657-
_nullPrefixScope = PrefixScope(
658-
libraryElement: container.library,
659-
parent: null,
660-
libraryImports: container.libraryImports,
661-
prefix: null,
662-
);
663-
664-
List<ExtensionElement> get extensions {
665-
return _extensions ??= {
666-
..._nullPrefixScope._extensions,
667-
for (var prefix in _container.prefixes)
668-
...(prefix.scope as PrefixScope)._extensions,
669-
}.toFixedList();
670-
}
671-
672-
@override
673-
ScopeLookupResult lookup(String id) {
674-
return _nullPrefixScope.lookup(id);
675-
}
676-
}

0 commit comments

Comments
 (0)