Skip to content

Commit 28a29f5

Browse files
author
Tim Blasi
committed
refactor(dart/transform): Make implementation details private
1 parent f3da37c commit 28a29f5

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

modules_dart/transform/lib/src/transform/common/annotation_matcher.dart

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ export 'class_matcher_base.dart' show ClassDescriptor;
99
/// [ClassDescriptor]s for the default angular annotations that can appear
1010
/// on a class. These classes are re-exported in many places so this covers all
1111
/// the possible libraries which could provide them.
12-
const INJECTABLES = const [
12+
const _INJECTABLES = const [
1313
const ClassDescriptor(
1414
'Injectable', 'package:angular2/src/core/di/decorators.dart'),
1515
const ClassDescriptor('Injectable', 'package:angular2/core.dart'),
1616
const ClassDescriptor('Injectable', 'package:angular2/src/core/di.dart'),
1717
const ClassDescriptor('Injectable', 'package:angular2/angular2.dart'),
1818
const ClassDescriptor('Injectable', 'package:angular2/bootstrap_static.dart'),
19-
const ClassDescriptor('Injectable', 'package:angular2/web_worker/worker.dart'),
19+
const ClassDescriptor(
20+
'Injectable', 'package:angular2/web_worker/worker.dart'),
2021
];
2122

22-
const DIRECTIVES = const [
23-
const ClassDescriptor('Directive', 'package:angular2/src/core/metadatada/directive.dart',
23+
const _DIRECTIVES = const [
24+
const ClassDescriptor(
25+
'Directive', 'package:angular2/src/core/metadatada/directive.dart',
2426
superClass: 'Injectable'),
2527
const ClassDescriptor('Directive', 'package:angular2/src/core/metadata.dart',
2628
superClass: 'Injectable'),
@@ -32,8 +34,9 @@ const DIRECTIVES = const [
3234
superClass: 'Injectable'),
3335
];
3436

35-
const COMPONENTS = const [
36-
const ClassDescriptor('Component', 'package:angular2/src/core/metadata/directive.dart',
37+
const _COMPONENTS = const [
38+
const ClassDescriptor(
39+
'Component', 'package:angular2/src/core/metadata/directive.dart',
3740
superClass: 'Directive'),
3841
const ClassDescriptor('Component', 'package:angular2/src/core/metadata.dart',
3942
superClass: 'Directive'),
@@ -45,7 +48,7 @@ const COMPONENTS = const [
4548
superClass: 'Directive'),
4649
];
4750

48-
const VIEWS = const [
51+
const _VIEWS = const [
4952
const ClassDescriptor('View', 'package:angular2/angular2.dart'),
5053
const ClassDescriptor('View', 'package:angular2/web_worker/worker.dart'),
5154
const ClassDescriptor('View', 'package:angular2/bootstrap_static.dart'),
@@ -61,10 +64,10 @@ class AnnotationMatcher extends ClassMatcherBase {
6164

6265
factory AnnotationMatcher() {
6366
return new AnnotationMatcher._([]
64-
..addAll(COMPONENTS)
65-
..addAll(DIRECTIVES)
66-
..addAll(INJECTABLES)
67-
..addAll(VIEWS));
67+
..addAll(_COMPONENTS)
68+
..addAll(_DIRECTIVES)
69+
..addAll(_INJECTABLES)
70+
..addAll(_VIEWS));
6871
}
6972

7073
bool _implementsWithWarning(Annotation annotation, AssetId assetId,
@@ -78,17 +81,17 @@ class AnnotationMatcher extends ClassMatcherBase {
7881

7982
/// Checks if an [Annotation] node implements [Injectable].
8083
bool isInjectable(Annotation annotation, AssetId assetId) =>
81-
_implementsWithWarning(annotation, assetId, INJECTABLES);
84+
_implementsWithWarning(annotation, assetId, _INJECTABLES);
8285

8386
/// Checks if an [Annotation] node implements [Directive].
8487
bool isDirective(Annotation annotation, AssetId assetId) =>
85-
_implementsWithWarning(annotation, assetId, DIRECTIVES);
88+
_implementsWithWarning(annotation, assetId, _DIRECTIVES);
8689

8790
/// Checks if an [Annotation] node implements [Component].
8891
bool isComponent(Annotation annotation, AssetId assetId) =>
89-
_implementsWithWarning(annotation, assetId, COMPONENTS);
92+
_implementsWithWarning(annotation, assetId, _COMPONENTS);
9093

9194
/// Checks if an [Annotation] node implements [View].
9295
bool isView(Annotation annotation, AssetId assetId) =>
93-
_implementsWithWarning(annotation, assetId, VIEWS);
96+
_implementsWithWarning(annotation, assetId, _VIEWS);
9497
}

0 commit comments

Comments
 (0)