Index: third_party/pkg/angular/lib/core/registry.dart |
diff --git a/third_party/pkg/angular/lib/core/registry.dart b/third_party/pkg/angular/lib/core/registry.dart |
deleted file mode 100644 |
index 17985f893b590e645e3e5d49e4a95336be795abc..0000000000000000000000000000000000000000 |
--- a/third_party/pkg/angular/lib/core/registry.dart |
+++ /dev/null |
@@ -1,78 +0,0 @@ |
-part of angular.core; |
- |
-abstract class AnnotationMap<K> { |
- final Map<K, Type> _map = {}; |
- |
- AnnotationMap(Injector injector, MetadataExtractor extractMetadata) { |
- injector.types.forEach((type) { |
- var meta = extractMetadata(type) |
- .where((annotation) => annotation is K) |
- .forEach((annotation) { |
- _map[annotation] = type; |
- }); |
- }); |
- } |
- |
- Type operator[](K annotation) { |
- var value = _map[annotation]; |
- if (value == null) throw 'No $annotation found!'; |
- return value; |
- } |
- |
- forEach(fn(K, Type)) => _map.forEach(fn); |
- |
- List<K> annotationsFor(Type type) { |
- var res = <K>[]; |
- forEach((ann, annType) { |
- if (annType == type) res.add(ann); |
- }); |
- return res; |
- } |
-} |
- |
-abstract class AnnotationsMap<K> { |
- final Map<K, List<Type>> map = {}; |
- |
- AnnotationsMap(Injector injector, MetadataExtractor extractMetadata) { |
- injector.types.forEach((type) { |
- var meta = extractMetadata(type) |
- .where((annotation) => annotation is K) |
- .forEach((annotation) { |
- map.putIfAbsent(annotation, () => []).add(type); |
- }); |
- }); |
- } |
- |
- List operator[](K annotation) { |
- var value = map[annotation]; |
- if (value == null) throw 'No $annotation found!'; |
- return value; |
- } |
- |
- forEach(fn(K, Type)) { |
- map.forEach((annotation, types) { |
- types.forEach((type) { |
- fn(annotation, type); |
- }); |
- }); |
- } |
- |
- List<K> annotationsFor(Type type) { |
- var res = <K>[]; |
- forEach((ann, annType) { |
- if (annType == type) res.add(ann); |
- }); |
- return res; |
- } |
-} |
- |
- |
-@NgInjectableService() |
-class MetadataExtractor { |
- Iterable call(Type type) { |
- if (reflectType(type) is TypedefMirror) return []; |
- var metadata = reflectClass(type).metadata; |
- if (metadata == null) return []; |
- return metadata.map((InstanceMirror im) => im.reflectee); |
- } |
-} |