[Fix] Replaces call to deprecated method Name.name. (#21241)

This commit is contained in:
Clement Skau 2020-09-25 17:40:55 +02:00 committed by GitHub
parent faeff0a89d
commit 7dfcde1ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -224,7 +224,7 @@ class ToStringVisitor extends RecursiveVisitor<void> {
@override
void visitProcedure(Procedure node) {
if (
node.name.name == 'toString' &&
node.name.text == 'toString' &&
node.enclosingClass != null &&
node.enclosingLibrary != null &&
!node.isStatic &&

View File

@ -194,7 +194,7 @@ void main(List<String> args) async {
final ReturnStatement replacement = verify(body.replaceWith(captureAny)).captured.single as ReturnStatement;
expect(replacement.expression, isA<SuperMethodInvocation>());
final SuperMethodInvocation superMethodInvocation = replacement.expression as SuperMethodInvocation;
expect(superMethodInvocation.name.name, 'toString');
expect(superMethodInvocation.name.text, 'toString');
}
test('ToStringVisitor replaces toString in specified libraries (dart:ui)', () {