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

Commit 04624f2

Browse files
committed
fix(registry_dynamic): Do not use HashMaps.
I saw failures due to these HashMaps in some apps but don't have a test case in Angular for this failure yet.
1 parent cca1bbe commit 04624f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/core/registry_dynamic.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DynamicMetadataExtractor implements MetadataExtractor {
4242
var match;
4343
var fieldMetadata = fieldMetadataExtractor(type);
4444
if (fieldMetadata.isNotEmpty) {
45-
var newMap = annotation.map == null ? new HashMap() : new HashMap.from(annotation.map);
45+
var newMap = annotation.map == null ? {} : new Map.from(annotation.map);
4646
fieldMetadata.forEach((String fieldName, DirectiveAnnotation ann) {
4747
var attrName = ann.attrName;
4848
if (newMap.containsKey(attrName)) {
@@ -61,11 +61,11 @@ class DynamicMetadataExtractor implements MetadataExtractor {
6161
_fieldMetadataCache.putIfAbsent(type, () => _fieldMetadataExtractor(reflectType(type)));
6262

6363
Map<String, DirectiveAnnotation> _fieldMetadataExtractor(ClassMirror cm) {
64-
var fields = new HashMap<String, DirectiveAnnotation>();
64+
var fields = <String, DirectiveAnnotation>{};
6565
if(cm.superclass != null) {
6666
fields.addAll(_fieldMetadataExtractor(cm.superclass));
6767
} else {
68-
fields = new HashMap();
68+
fields = {};
6969
}
7070
Map<Symbol, DeclarationMirror> declarations = cm.declarations;
7171
declarations.forEach((symbol, dm) {

0 commit comments

Comments
 (0)