[Fix] Replaces call to deprecated method Name.name. (flutter/engine#21241)
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -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)', () {
|
||||
|
||||
Reference in New Issue
Block a user