Skip to content

Commit

Permalink
[CQ] Remove dead code from ElementLocationImpl
Browse files Browse the repository at this point in the history
Change-Id: I44ca6362926419d2065b6b6a7045d87a37eff478
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403622
Commit-Queue: Brian Wilkerson <[email protected]>
Reviewed-by: Konstantin Shcheglov <[email protected]>
  • Loading branch information
bwilkerson authored and Commit Queue committed Jan 8, 2025
1 parent 6254583 commit 491f4f4
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions pkg/analyzer/lib/src/dart/element/element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3466,39 +3466,6 @@ class ElementLocationImpl implements ElementLocation {
_components = _decode(encoding);
}

/// Initialize a newly created location from the given [components].
ElementLocationImpl.con3(List<String> components) {
_components = components;
}

/// Initialize a newly created location to represent the given [element].
ElementLocationImpl.fromElement(Element2 element) {
List<String> components = <String>[];
Element2? ancestor = element;
while (ancestor != null) {
if (ancestor is! ElementImpl2) {
if (ancestor is LibraryElementImpl) {
components.insert(0, ancestor.identifier);
} else if (ancestor is AugmentableElement) {
components.insert(0, ancestor.identifier);
} else {
throw '${ancestor.runtimeType} is not an ElementImpl2';
}
ancestor = ancestor.enclosingElement2;
} else {
components.insert(0, ancestor.identifier);
if (ancestor is LocalFunctionElementImpl) {
ancestor = (ancestor.wrappedElement._enclosingElement3
as ExecutableElementImpl)
.element;
} else {
ancestor = ancestor.enclosingElement2;
}
}
}
_components = components.toFixedList();
}

@override
List<String> get components => _components;

Expand Down

0 comments on commit 491f4f4

Please sign in to comment.