diff --git a/lib/animate/css_animate.dart b/lib/animate/css_animate.dart index db5bebaee..f2c3ed5c0 100644 --- a/lib/animate/css_animate.dart +++ b/lib/animate/css_animate.dart @@ -134,11 +134,11 @@ class CssAnimate implements Animate { @Injectable() class CssAnimationMap { final Map> cssAnimations - = new Map>(); + = new HashMap>(); void track(CssAnimation animation) { var animations = cssAnimations.putIfAbsent(animation.element, - () => {}); + () => new HashMap()); animations[animation.eventClass] = animation; } diff --git a/lib/animate/module.dart b/lib/animate/module.dart index 44a700613..d7d68ee5a 100644 --- a/lib/animate/module.dart +++ b/lib/animate/module.dart @@ -113,6 +113,7 @@ import 'package:di/di.dart'; 'angular.animate' ]) import 'dart:mirrors' show MirrorsUsed; +import 'dart:collection'; part 'animations.dart'; part 'animation_loop.dart'; diff --git a/lib/change_detection/dirty_checking_change_detector.dart b/lib/change_detection/dirty_checking_change_detector.dart index eef538e26..d59ebb7e3 100644 --- a/lib/change_detection/dirty_checking_change_detector.dart +++ b/lib/change_detection/dirty_checking_change_detector.dart @@ -543,7 +543,7 @@ class DirtyCheckingRecord implements Record, WatchRecord { final Object _INITIAL_ = new Object(); class _MapChangeRecord implements MapChangeRecord { - final _records = new Map(); + final _records = new HashMap(); Map _map; Map get map => _map; @@ -1414,7 +1414,7 @@ class _DuplicateItemRecordList { * The list of duplicates is implemented by [_DuplicateItemRecordList]. */ class DuplicateMap { - final map = {}; + final map = new HashMap(); void put(ItemRecord record, [ItemRecord insertBefore = null]) { map.putIfAbsent(record.item, () => new _DuplicateItemRecordList()).add(record, insertBefore); diff --git a/lib/change_detection/prototype_map.dart b/lib/change_detection/prototype_map.dart index 130444184..3c634b36c 100644 --- a/lib/change_detection/prototype_map.dart +++ b/lib/change_detection/prototype_map.dart @@ -2,7 +2,7 @@ part of angular.watch_group; class PrototypeMap implements Map { final Map prototype; - final Map self = new Map(); + final Map self = new HashMap(); PrototypeMap(this.prototype); diff --git a/lib/change_detection/watch_group.dart b/lib/change_detection/watch_group.dart index 25ea579bd..f257260d5 100644 --- a/lib/change_detection/watch_group.dart +++ b/lib/change_detection/watch_group.dart @@ -1,6 +1,7 @@ library angular.watch_group; import 'package:angular/change_detection/change_detection.dart'; +import 'dart:collection'; part 'linked_list.dart'; part 'ast.dart'; @@ -119,7 +120,7 @@ class WatchGroup implements _EvalWatchList, _WatchGroupList { : id = '', _rootGroup = null, _parentWatchGroup = null, - _cache = new Map>() + _cache = new HashMap>() { _marker.watchGrp = this; _evalWatchTail = _evalWatchHead = _marker; @@ -289,7 +290,7 @@ class WatchGroup implements _EvalWatchList, _WatchGroupList { this, _changeDetector.newGroup(), context == null ? this.context : context, - >{}, + new HashMap>(), _rootGroup == null ? this : _rootGroup); _WatchGroupList._add(this, childGroup); var marker = childGroup._marker; @@ -680,7 +681,7 @@ class _NamedArgHandler extends _ArgHandler { void acceptValue(object) { if (watchRecord.namedArgs == null) { - watchRecord.namedArgs = new Map(); + watchRecord.namedArgs = new HashMap(); } watchRecord.dirtyArgs = true; watchRecord.namedArgs[name] = object; diff --git a/lib/core/cache.dart b/lib/core/cache.dart index 196a6a4ef..8786af1e1 100644 --- a/lib/core/cache.dart +++ b/lib/core/cache.dart @@ -43,7 +43,7 @@ abstract class Cache { * An unbounded cache. */ class UnboundedCache implements Cache { - Map _entries = {}; + Map _entries = new HashMap(); int _hits = 0; int _misses = 0; diff --git a/lib/core/interpolate.dart b/lib/core/interpolate.dart index 8c74a2c23..92c69616f 100644 --- a/lib/core/interpolate.dart +++ b/lib/core/interpolate.dart @@ -10,7 +10,7 @@ part of angular.core_internal; */ @Injectable() class Interpolate implements Function { - var _cache = {}; + var _cache = new HashMap(); /** * Compiles markup text into expression. * diff --git a/lib/core/parser/static_parser.dart b/lib/core/parser/static_parser.dart index ac097c67a..f7a045898 100644 --- a/lib/core/parser/static_parser.dart +++ b/lib/core/parser/static_parser.dart @@ -16,7 +16,7 @@ class StaticParserFunctions { class StaticParser implements Parser { final StaticParserFunctions _functions; final DynamicParser _fallbackParser; - final _cache = {}; + final _cache = new HashMap(); StaticParser(this._functions, this._fallbackParser); Expression call(String input) { diff --git a/lib/core/registry_dynamic.dart b/lib/core/registry_dynamic.dart index 54ea6573d..d060ab1ff 100644 --- a/lib/core/registry_dynamic.dart +++ b/lib/core/registry_dynamic.dart @@ -3,11 +3,12 @@ library angular.core_dynamic; import 'dart:mirrors'; import 'package:angular/core/annotation_src.dart'; import 'package:angular/core/registry.dart'; +import 'dart:collection'; export 'package:angular/core/registry.dart' show MetadataExtractor; -var _fieldMetadataCache = new Map>(); +var _fieldMetadataCache = new HashMap>(); class DynamicMetadataExtractor implements MetadataExtractor { final _fieldAnnotations = [ @@ -41,7 +42,7 @@ class DynamicMetadataExtractor implements MetadataExtractor { var match; var fieldMetadata = fieldMetadataExtractor(type); if (fieldMetadata.isNotEmpty) { - var newMap = annotation.map == null ? {} : new Map.from(annotation.map); + var newMap = annotation.map == null ? new HashMap() : new HashMap.from(annotation.map); fieldMetadata.forEach((String fieldName, DirectiveAnnotation ann) { var attrName = ann.attrName; if (newMap.containsKey(attrName)) { @@ -60,11 +61,11 @@ class DynamicMetadataExtractor implements MetadataExtractor { _fieldMetadataCache.putIfAbsent(type, () => _fieldMetadataExtractor(reflectType(type))); Map _fieldMetadataExtractor(ClassMirror cm) { - var fields = {}; + var fields = new HashMap(); if(cm.superclass != null) { fields.addAll(_fieldMetadataExtractor(cm.superclass)); } else { - fields = {}; + fields = new HashMap(); } Map declarations = cm.declarations; declarations.forEach((symbol, dm) { diff --git a/lib/core/scope.dart b/lib/core/scope.dart index f891d1d24..4104dd313 100644 --- a/lib/core/scope.dart +++ b/lib/core/scope.dart @@ -275,7 +275,7 @@ class Scope { WatchGroup group = canChangeModel ? _readWriteGroup : _readOnlyGroup; return group.watch(ast, reactionFn); } - static Map _oneTimeWarnings = {}; + static Map _oneTimeWarnings = new HashMap(); dynamic eval(expression, [Map locals]) { assert(isAttached); @@ -369,8 +369,8 @@ class Scope { Map _verifyStreams(parentScope, prefix, log) { assert(_parentScope == parentScope); - var counts = {}; - var typeCounts = _streams == null ? {} : _streams._typeCounts; + var counts = new HashMap(); + var typeCounts = _streams == null ? new HashMap() : _streams._typeCounts; var connection = _streams != null && _streams._scope == this ? '=' : '-'; log..add(prefix)..add(hashCode)..add(connection)..add(typeCounts)..add('\n'); if (_streams == null) { @@ -862,14 +862,14 @@ class _Streams { /// Scope we belong to. final Scope _scope; /// [Stream]s for [_scope] only - final _streams = new Map(); + final _streams = new HashMap(); /// Child [Scope] event counts. final Map _typeCounts; _Streams(this._scope, this._exceptionHandler, _Streams inheritStreams) : _typeCounts = inheritStreams == null - ? {} - : new Map.from(inheritStreams._typeCounts); + ? new HashMap() + : new HashMap.from(inheritStreams._typeCounts); static ScopeEvent emit(Scope scope, String name, data) { var event = new ScopeEvent(name, scope, data); diff --git a/lib/core_dom/directive.dart b/lib/core_dom/directive.dart index ec846f7ca..8738fe273 100644 --- a/lib/core_dom/directive.dart +++ b/lib/core_dom/directive.dart @@ -18,7 +18,7 @@ class NodeAttrs { final dom.Element element; Map> _observers; - final _mustacheAttrs = {}; + final _mustacheAttrs = new HashMap(); NodeAttrs(this.element); @@ -49,7 +49,7 @@ class NodeAttrs { * [:true:] */ observe(String attrName, notifyFn(String value)) { - if (_observers == null) _observers = >{}; + if (_observers == null) _observers = new HashMap>(); _observers.putIfAbsent(attrName, () => <_AttributeChanged>[]) .add(notifyFn); diff --git a/lib/core_dom/element_binder_builder.dart b/lib/core_dom/element_binder_builder.dart index 7c97648ab..dfa070d71 100644 --- a/lib/core_dom/element_binder_builder.dart +++ b/lib/core_dom/element_binder_builder.dart @@ -40,9 +40,9 @@ class ElementBinderBuilder { final FormatterMap _formatters; /// "on-*" attribute names and values, added by a [DirectiveSelector] - final onEvents = {}; + final onEvents = new HashMap(); /// "bind-*" attribute names and values, added by a [DirectiveSelector] - final bindAttrs = {}; + final bindAttrs = new HashMap(); final decorators = []; DirectiveRef template; diff --git a/lib/core_dom/event_handler.dart b/lib/core_dom/event_handler.dart index 1a0f5d9b5..b47fb59b7 100644 --- a/lib/core_dom/event_handler.dart +++ b/lib/core_dom/event_handler.dart @@ -31,7 +31,7 @@ class EventHandler { dom.Node _rootNode; final Expando _expando; final ExceptionHandler _exceptionHandler; - final _listeners = {}; + final _listeners = new HashMap(); EventHandler(this._rootNode, this._expando, this._exceptionHandler); diff --git a/lib/core_dom/http.dart b/lib/core_dom/http.dart index 67fa4f0ea..36e3e8b05 100644 --- a/lib/core_dom/http.dart +++ b/lib/core_dom/http.dart @@ -369,7 +369,7 @@ class HttpDefaults { */ @Injectable() class Http { - var _pendingRequests = >{}; + var _pendingRequests = new HashMap>(); BrowserCookies _cookies; LocationWrapper _location; UrlRewriter _rewriter; @@ -649,7 +649,7 @@ class Http { static Map parseHeaders(dom.HttpRequest value) { var headers = value.getAllResponseHeaders(); - var parsed = {}; + var parsed = new HashMap(); if (headers == null) return parsed; diff --git a/lib/core_dom/module_internal.dart b/lib/core_dom/module_internal.dart index c8bea0924..79f912024 100644 --- a/lib/core_dom/module_internal.dart +++ b/lib/core_dom/module_internal.dart @@ -20,6 +20,7 @@ import 'package:angular/change_detection/ast_parser.dart'; import 'package:angular/core/registry.dart'; import 'package:angular/directive/module.dart' show NgBaseCss; +import 'dart:collection'; part 'animation.dart'; part 'view.dart'; diff --git a/lib/core_dom/ng_element.dart b/lib/core_dom/ng_element.dart index b6d12d022..08de548d2 100644 --- a/lib/core_dom/ng_element.dart +++ b/lib/core_dom/ng_element.dart @@ -8,8 +8,8 @@ class NgElement { final Scope _scope; final Animate _animate; - final _classesToUpdate = {}; - final _attributesToUpdate = {}; + final _classesToUpdate = new HashMap(); + final _attributesToUpdate = new HashMap(); bool _writeScheduled = false; diff --git a/lib/core_dom/selector.dart b/lib/core_dom/selector.dart index 48e8b0c65..d6a19d976 100644 --- a/lib/core_dom/selector.dart +++ b/lib/core_dom/selector.dart @@ -62,7 +62,7 @@ class DirectiveSelector { ElementBinderBuilder builder = _binderFactory.builder(_formatters, _directives); List<_ElementSelector> partialSelection; final classes = new Set(); - final attrs = {}; + final attrs = new HashMap(); dom.Element element = node; String nodeName = element.tagName.toLowerCase(); @@ -234,14 +234,14 @@ _addRefs(ElementBinderBuilder builder, List<_Directive> directives, dom.Node nod class _ElementSelector { final String _name; - final _elementMap = >{}; - final _elementPartialMap = {}; + final _elementMap = new HashMap>(); + final _elementPartialMap = new HashMap(); - final _classMap = >{}; - final _classPartialMap = {}; + final _classMap = new HashMap>(); + final _classPartialMap = new HashMap(); - final _attrValueMap = >>{}; - final _attrValuePartialMap = >{}; + final _attrValueMap = new HashMap>>(); + final _attrValuePartialMap = new HashMap>(); _ElementSelector(this._name); @@ -268,12 +268,12 @@ class _ElementSelector { } } else if ((name = part.attrName) != null) { if (terminal) { - elSelector._attrValueMap.putIfAbsent(name, () => >{}) + elSelector._attrValueMap.putIfAbsent(name, () => new HashMap>()) .putIfAbsent(part.attrValue, () => []) .add(directive); } else { elSelector = elSelector._attrValuePartialMap - .putIfAbsent(name, () => {}) + .putIfAbsent(name, () => new HashMap()) .putIfAbsent(part.attrValue, () => new _ElementSelector(name)); } } else { @@ -349,7 +349,7 @@ class _ElementSelector { // A global cache for the _matchingKey RegExps. The size is bounded by // the number of attribute directive selectors used in the application. - static var _matchingKeyCache = {}; + static var _matchingKeyCache = new HashMap(); String _matchingKey(Iterable keys, String attrName) => keys.firstWhere((key) => diff --git a/lib/directive/module.dart b/lib/directive/module.dart index a374ff1bb..b0accbf27 100644 --- a/lib/directive/module.dart +++ b/lib/directive/module.dart @@ -28,6 +28,7 @@ import 'package:angular/utils.dart'; import 'package:angular/change_detection/watch_group.dart'; import 'package:angular/change_detection/change_detection.dart'; import 'package:angular/directive/static_keys.dart'; +import 'dart:collection'; part 'a_href.dart'; part 'ng_base_css.dart'; diff --git a/lib/directive/ng_events.dart b/lib/directive/ng_events.dart index 14c422d3f..e032f2388 100644 --- a/lib/directive/ng_events.dart +++ b/lib/directive/ng_events.dart @@ -133,7 +133,7 @@ class NgEvent { // Is it better to use a map of listeners or have 29 properties on this // object? One would pretty much only assign to one or two of those // properties. I'm opting for the map since it's less boilerplate code. - var listeners = {}; + var listeners = new HashMap(); final dom.Element element; final Scope scope; diff --git a/lib/directive/ng_repeat.dart b/lib/directive/ng_repeat.dart index b6f92c646..194316c2f 100644 --- a/lib/directive/ng_repeat.dart +++ b/lib/directive/ng_repeat.dart @@ -107,7 +107,7 @@ class NgRepeat { if (trackByExpr != null) { Expression trackBy = _parser(trackByExpr); _generateId = ((key, value, index) { - final context = {} + final context = new HashMap() ..[_valueIdentifier] = value ..[r'$index'] = index ..[r'$id'] = (obj) => obj; diff --git a/lib/routing/module.dart b/lib/routing/module.dart index 624c1ed0c..3d497ae32 100644 --- a/lib/routing/module.dart +++ b/lib/routing/module.dart @@ -133,6 +133,7 @@ import 'package:angular/core_dom/module_internal.dart'; import 'package:route_hierarchical/client.dart'; import 'package:angular/routing/static_keys.dart'; +import 'dart:collection'; part 'routing.dart'; part 'ng_view.dart'; diff --git a/lib/routing/ng_view.dart b/lib/routing/ng_view.dart index a9c489d15..02b9c4783 100644 --- a/lib/routing/ng_view.dart +++ b/lib/routing/ng_view.dart @@ -138,7 +138,7 @@ class NgView implements DetachAware, RouteProvider { String get routeName => _viewRoute.name; Map get parameters { - var res = {}; + var res = new HashMap(); var p = _viewRoute; while (p != null) { res.addAll(p.parameters);