Fix using deprecated AnalysisSession APIs in dartfuzz.
Change-Id: I1d4ae47de90aa1465b009960e75de68ab3a9a317 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199880 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
d8f16966df
commit
d4aef249b4
@@ -330,11 +330,12 @@ void main() async {
|
||||
|
||||
Future<void> visitLibraryAtUri(AnalysisSession session, String uri) async {
|
||||
final libPath = session.uriConverter.uriToPath(Uri.parse(uri));
|
||||
var result = await session.getResolvedLibrary(libPath);
|
||||
if (result.state != ResultState.VALID) {
|
||||
var result = await session.getResolvedLibrary2(libPath);
|
||||
if (result is ResolvedLibraryResult) {
|
||||
visitLibrary(result.element);
|
||||
} else {
|
||||
throw StateError('Unable to resolve "$uri"');
|
||||
}
|
||||
visitLibrary(result.element);
|
||||
}
|
||||
|
||||
void visitLibrary(LibraryElement library) {
|
||||
|
||||
@@ -1268,11 +1268,12 @@ Future<void> getDataTypes(Set<InterfaceType> allTypes, String dartTop) async {
|
||||
Future<void> visitLibraryAtUri(
|
||||
AnalysisSession session, String uri, Set<InterfaceType> allTypes) async {
|
||||
var libPath = session.uriConverter.uriToPath(Uri.parse(uri));
|
||||
var result = await session.getResolvedLibrary(libPath);
|
||||
if (result.state != ResultState.VALID) {
|
||||
var result = await session.getResolvedLibrary2(libPath);
|
||||
if (result is ResolvedLibraryResult) {
|
||||
visitLibrary(result.element, allTypes);
|
||||
} else {
|
||||
throw StateError('Unable to resolve "$uri"');
|
||||
}
|
||||
visitLibrary(result.element, allTypes);
|
||||
}
|
||||
|
||||
void visitLibrary(LibraryElement library, Set<InterfaceType> allTypes) {
|
||||
|
||||
Reference in New Issue
Block a user