mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Fix] Replaces call to deprecated method Name.name. (#21241)
This commit is contained in:
parent
faeff0a89d
commit
7dfcde1ff1
@ -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)', () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user