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>
This commit is contained in:
Brian Wilkerson 2018-03-29 17:29:19 +00:00 committed by commit-bot@chromium.org
parent 506ac7f953
commit 055dfad887

View file

@ -6618,8 +6618,13 @@ class LibraryElementImpl extends ElementImpl implements LibraryElement {
bool get isDartCore => name == "dart.core";
@override
bool get isInSdk =>
StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x74, 0x2E);
bool get isInSdk {
Uri uri = definingCompilationUnit.source?.uri;
if (uri != null) {
return DartUriResolver.isDartUri(uri);
}
return false;
}
/**
* Return `true` if the receiver directly or indirectly imports the