Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: pkg/analyzer/lib/src/dart/element/member.dart

Issue 1814453002: Remove more calls to safelyVisit methods (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.element.member; 5 library analyzer.src.dart.element.member;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/dart/element/type.dart'; 9 import 'package:analyzer/dart/element/type.dart';
10 import 'package:analyzer/src/dart/element/element.dart'; 10 import 'package:analyzer/src/dart/element/element.dart';
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 String getExtendedDisplayName(String shortName) => 517 String getExtendedDisplayName(String shortName) =>
518 _baseElement.getExtendedDisplayName(shortName); 518 _baseElement.getExtendedDisplayName(shortName);
519 519
520 @override 520 @override
521 bool isAccessibleIn(LibraryElement library) => 521 bool isAccessibleIn(LibraryElement library) =>
522 _baseElement.isAccessibleIn(library); 522 _baseElement.isAccessibleIn(library);
523 523
524 /** 524 /**
525 * If the given [child] is not `null`, use the given [visitor] to visit it. 525 * If the given [child] is not `null`, use the given [visitor] to visit it.
526 */ 526 */
527 @deprecated
527 void safelyVisitChild(Element child, ElementVisitor visitor) { 528 void safelyVisitChild(Element child, ElementVisitor visitor) {
528 // TODO(brianwilkerson) Make this private 529 // TODO(brianwilkerson) Make this private
529 if (child != null) { 530 if (child != null) {
530 child.accept(visitor); 531 child.accept(visitor);
531 } 532 }
532 } 533 }
533 534
534 /** 535 /**
535 * Use the given [visitor] to visit all of the [children]. 536 * Use the given [visitor] to visit all of the [children].
536 */ 537 */
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 // return getBaseElement().getInitializer(); 1011 // return getBaseElement().getInitializer();
1011 } 1012 }
1012 1013
1013 @override 1014 @override
1014 bool get isConst => baseElement.isConst; 1015 bool get isConst => baseElement.isConst;
1015 1016
1016 @override 1017 @override
1017 bool get isFinal => baseElement.isFinal; 1018 bool get isFinal => baseElement.isFinal;
1018 1019
1019 @override 1020 @override
1021 @deprecated
1020 bool get isPotentiallyMutatedInClosure => 1022 bool get isPotentiallyMutatedInClosure =>
1021 baseElement.isPotentiallyMutatedInClosure; 1023 baseElement.isPotentiallyMutatedInClosure;
1022 1024
1023 @override 1025 @override
1026 @deprecated
1024 bool get isPotentiallyMutatedInScope => 1027 bool get isPotentiallyMutatedInScope =>
1025 baseElement.isPotentiallyMutatedInScope; 1028 baseElement.isPotentiallyMutatedInScope;
1026 1029
1027 @override 1030 @override
1028 bool get isStatic => baseElement.isStatic; 1031 bool get isStatic => baseElement.isStatic;
1029 1032
1030 @override 1033 @override
1031 void visitChildren(ElementVisitor visitor) { 1034 void visitChildren(ElementVisitor visitor) {
1032 // TODO(brianwilkerson) We need to finish implementing the accessors used 1035 // TODO(brianwilkerson) We need to finish implementing the accessors used
1033 // below so that we can safely invoke them. 1036 // below so that we can safely invoke them.
1034 super.visitChildren(visitor); 1037 super.visitChildren(visitor);
1035 safelyVisitChild(baseElement.initializer, visitor); 1038 baseElement.initializer?.accept(visitor);
1036 } 1039 }
1037 } 1040 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698