mirror of
https://github.com/dart-lang/sdk
synced 2024-09-30 04:08:32 +00:00
[kernel] Fix crash in dart_scope_calculator when all scopes are artificial
Fixes https://github.com/dart-lang/sdk/issues/55986 Change-Id: Icc7e6dbb4272613e838b0bd2ef9ac4764dd068f1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373200 Commit-Queue: Jens Johansen <jensj@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
01cf48f653
commit
a8314dac74
|
@ -633,6 +633,9 @@ class DartScopeBuilder2 extends VisitorDefault<void> with VisitorVoidMixin {
|
|||
List<DartScope2> rawScopes, Library library, int offset) {
|
||||
List<DartScope2> firstFilteredScopes =
|
||||
_filterScopesWithArtificialNodes(rawScopes, library);
|
||||
if (firstFilteredScopes.isEmpty) {
|
||||
return rawScopes;
|
||||
}
|
||||
if (_allHaveTheSameDefinitions(firstFilteredScopes)) {
|
||||
return [firstFilteredScopes.first];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue