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

Unified Diff: lib/src/ast.dart

Issue 1407283008: Verify type annotations on public APIs (#24). (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/rules.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/ast.dart
diff --git a/lib/src/ast.dart b/lib/src/ast.dart
index 5bd3bdf9392224cbc0b1f79b8d2529964896b288..6556d5608929572a5407bb51bcf1d700c33e6641 100644
--- a/lib/src/ast.dart
+++ b/lib/src/ast.dart
@@ -24,6 +24,7 @@ import 'package:analyzer/src/generated/ast.dart'
FieldDeclaration,
FunctionDeclaration,
FunctionTypeAlias,
+ Identifier,
MethodDeclaration,
ReturnStatement,
SimpleIdentifier,
@@ -243,6 +244,10 @@ AstNode _getNodeToAnnotate(Declaration node) {
return null;
}
+/// Check if the given identifier has a private name.
+bool isPrivate(SimpleIdentifier identifier) =>
+ identifier != null ? Identifier.isPrivateName(identifier.name) : false;
+
/// An [Element] processor function type.
/// If `true` is returned, children of [element] will be visited.
typedef bool ElementProcessor(Element element);
« no previous file with comments | « no previous file | lib/src/rules.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698