Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 055dfad

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Fix the test to determine whether a library is in the SDK
Change-Id: I711daae49f27ca21fb4adce3c10ccb1bfc9d72a8 Reviewed-on: https://dart-review.googlesource.com/48760 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
1 parent 506ac7f commit 055dfad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6618,8 +6618,13 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
66186618
bool get isDartCore => name == "dart.core";
66196619

66206620
@override
6621-
bool get isInSdk =>
6622-
StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x74, 0x2E);
6621+
bool get isInSdk {
6622+
Uri uri = definingCompilationUnit.source?.uri;
6623+
if (uri != null) {
6624+
return DartUriResolver.isDartUri(uri);
6625+
}
6626+
return false;
6627+
}
66236628

66246629
/**
66256630
* Return `true` if the receiver directly or indirectly imports the

0 commit comments

Comments
 (0)