chore: Fixing review comments on Dart transformers

See https://codereview.chromium.org/927373004/

Closes #705
This commit is contained in:
Tim Blasi
2015-02-18 21:08:42 -08:00
committed by Misko Hevery
parent fb5b168b19
commit 4d56a1e1af
9 changed files with 41 additions and 42 deletions
@@ -1,3 +1,5 @@
library angular2.src.transform;
import 'dart:collection' show Queue;
import 'package:analyzer/src/generated/element.dart';
@@ -5,7 +7,7 @@ import 'package:analyzer/src/generated/element.dart';
/// [_annotationClass] and reporting the resulting (element, annotation) pairs.
class AnnotationMatcher {
/// Queue for annotations.
final initQueue = new Queue<AnnotationMatch>();
final matchQueue = new Queue<AnnotationMatch>();
/// All the annotations we have seen for each element
final _seenAnnotations = new Map<Element, Set<ElementAnnotation>>();
@@ -16,7 +18,7 @@ class AnnotationMatcher {
/// Records all [_annotationClass] annotations and the [element]s they apply to.
/// Returns [true] if 1) [element] is annotated with [_annotationClass] and
/// 2) ([element], [_annotationClass]) has been seen previously.
/// 2) ([element], [_annotationClass]) has not been seen previously.
bool processAnnotations(ClassElement element) {
var found = false;
element.metadata.where((ElementAnnotation meta) {
@@ -31,7 +33,7 @@ class AnnotationMatcher {
.contains(meta);
}).forEach((ElementAnnotation meta) {
_seenAnnotations[element].add(meta);
initQueue.addLast(new AnnotationMatch(element, meta));
matchQueue.addLast(new AnnotationMatch(element, meta));
found = true;
});
return found;