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

Unified Diff: third_party/pkg/angular/lib/core_dom/directive_map.dart

Issue 1058283006: Update pubspecs and dependencies to get pkgbuild tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pkg/angular/lib/core_dom/directive.dart ('k') | third_party/pkg/angular/lib/core_dom/http.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/lib/core_dom/directive_map.dart
diff --git a/third_party/pkg/angular/lib/core_dom/directive_map.dart b/third_party/pkg/angular/lib/core_dom/directive_map.dart
deleted file mode 100644
index aff3f8c1e8687df6b3f85b411faec79308272692..0000000000000000000000000000000000000000
--- a/third_party/pkg/angular/lib/core_dom/directive_map.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-part of angular.core.dom;
-
-@NgInjectableService()
-class DirectiveMap extends AnnotationsMap<NgAnnotation> {
- DirectiveSelector selector;
-
- DirectiveMap(Injector injector, MetadataExtractor metadataExtractor,
- FieldMetadataExtractor fieldMetadataExtractor)
- : super(injector, metadataExtractor) {
- Map<NgAnnotation, List<Type>> directives = {};
- forEach((NgAnnotation annotation, Type type) {
- var match;
- var fieldMetadata = fieldMetadataExtractor(type);
- if (fieldMetadata.isNotEmpty) {
- var newMap = annotation.map == null ? {} : new Map.from(annotation.map);
- fieldMetadata.forEach((String fieldName, AttrFieldAnnotation ann) {
- var attrName = ann.attrName;
- if (newMap.containsKey(attrName)) {
- throw 'Mapping for attribute $attrName is already defined (while '
- 'processing annottation for field $fieldName of $type)';
- }
- newMap[attrName] = '${ann.mappingSpec}$fieldName';
- });
- annotation = annotation.cloneWithNewMap(newMap);
- }
- directives.putIfAbsent(annotation, () => []).add(type);
- });
- map.clear();
- map.addAll(directives);
-
- selector = directiveSelectorFactory(this);
- }
-}
-
-@NgInjectableService()
-class FieldMetadataExtractor {
- List<TypeMirror> _fieldAnnotations = [reflectType(NgAttr),
- reflectType(NgOneWay), reflectType(NgOneWayOneTime),
- reflectType(NgTwoWay), reflectType(NgCallback)];
-
- Map<String, AttrFieldAnnotation> call(Type type) {
- ClassMirror cm = reflectType(type);
- Map<String, AttrFieldAnnotation> fields = <String, AttrFieldAnnotation>{};
- cm.declarations.forEach((Symbol name, DeclarationMirror decl) {
- if (decl is VariableMirror ||
- (decl is MethodMirror && (decl.isGetter || decl.isSetter))) {
- var fieldName = MirrorSystem.getName(name);
- if (decl is MethodMirror && decl.isSetter) {
- // Remove = from the end of the setter.
- fieldName = fieldName.substring(0, fieldName.length - 1);
- }
- decl.metadata.forEach((InstanceMirror meta) {
- if (_fieldAnnotations.contains(meta.type)) {
- if (fields[fieldName] != null) {
- throw 'Attribute annotation for $fieldName is defined more '
- 'than once in $type';
- }
- fields[fieldName] = meta.reflectee as AttrFieldAnnotation;
- }
- });
- }
- });
- return fields;
- }
-}
« no previous file with comments | « third_party/pkg/angular/lib/core_dom/directive.dart ('k') | third_party/pkg/angular/lib/core_dom/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698