Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
fix(registry_dynamic): Do not use HashMaps.
Browse files Browse the repository at this point in the history
I saw failures due to these HashMaps in some apps but don't have a
test case in Angular for this failure yet.
  • Loading branch information
jbdeboer committed Jul 3, 2014
1 parent cca1bbe commit 04624f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/core/registry_dynamic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DynamicMetadataExtractor implements MetadataExtractor {
var match;
var fieldMetadata = fieldMetadataExtractor(type);
if (fieldMetadata.isNotEmpty) {
var newMap = annotation.map == null ? new HashMap() : new HashMap.from(annotation.map);
var newMap = annotation.map == null ? {} : new Map.from(annotation.map);
fieldMetadata.forEach((String fieldName, DirectiveAnnotation ann) {
var attrName = ann.attrName;
if (newMap.containsKey(attrName)) {
Expand All @@ -61,11 +61,11 @@ class DynamicMetadataExtractor implements MetadataExtractor {
_fieldMetadataCache.putIfAbsent(type, () => _fieldMetadataExtractor(reflectType(type)));

Map<String, DirectiveAnnotation> _fieldMetadataExtractor(ClassMirror cm) {
var fields = new HashMap<String, DirectiveAnnotation>();
var fields = <String, DirectiveAnnotation>{};
if(cm.superclass != null) {
fields.addAll(_fieldMetadataExtractor(cm.superclass));
} else {
fields = new HashMap();
fields = {};
}
Map<Symbol, DeclarationMirror> declarations = cm.declarations;
declarations.forEach((symbol, dm) {
Expand Down

0 comments on commit 04624f2

Please sign in to comment.