| Index: pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart
|
| diff --git a/pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart
|
| index 5e2a79c9ff31284421a03ad26738a8736721c5a9..429f40e7ec90a836d4fd8e386e254e8781cc2a55 100644
|
| --- a/pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart
|
| +++ b/pkg/dev_compiler/tool/input_sdk/patch/collection_patch.dart
|
| @@ -4,19 +4,28 @@
|
|
|
| // Patch file for dart:collection classes.
|
| import 'dart:_foreign_helper' show JS;
|
| -import 'dart:_js_helper' show
|
| - fillLiteralMap, InternalMap, NoInline, NoSideEffects, NoThrows, patch,
|
| - JsLinkedHashMap, LinkedHashMapCell, LinkedHashMapKeyIterable,
|
| - LinkedHashMapKeyIterator;
|
| +import 'dart:_js_helper'
|
| + show
|
| + fillLiteralMap,
|
| + InternalMap,
|
| + NoInline,
|
| + NoSideEffects,
|
| + NoThrows,
|
| + patch,
|
| + JsLinkedHashMap,
|
| + LinkedHashMapCell,
|
| + LinkedHashMapKeyIterable,
|
| + LinkedHashMapKeyIterator;
|
|
|
| const _USE_ES6_MAPS = true;
|
|
|
| @patch
|
| class HashMap<K, V> {
|
| @patch
|
| - factory HashMap({ bool equals(K key1, K key2),
|
| - int hashCode(K key),
|
| - bool isValidKey(Object potentialKey) }) {
|
| + factory HashMap(
|
| + {bool equals(K key1, K key2),
|
| + int hashCode(K key),
|
| + bool isValidKey(Object potentialKey)}) {
|
| if (isValidKey == null) {
|
| if (hashCode == null) {
|
| if (equals == null) {
|
| @@ -70,7 +79,6 @@ class _HashMap<K, V> implements HashMap<K, V> {
|
|
|
| _HashMap();
|
|
|
| -
|
| int get length => _length;
|
| bool get isEmpty => _length == 0;
|
| bool get isNotEmpty => !isEmpty;
|
| @@ -112,7 +120,7 @@ class _HashMap<K, V> implements HashMap<K, V> {
|
| });
|
| }
|
|
|
| - V operator[](Object key) {
|
| + V operator [](Object key) {
|
| if (_isStringKey(key)) {
|
| var strings = _strings;
|
| return (strings == null) ? null : _getTableEntry(strings, key);
|
| @@ -132,7 +140,7 @@ class _HashMap<K, V> implements HashMap<K, V> {
|
| return (index < 0) ? null : JS('var', '#[#]', bucket, index + 1);
|
| }
|
|
|
| - void operator[]=(K key, V value) {
|
| + void operator []=(K key, V value) {
|
| if (_isStringKey(key)) {
|
| var strings = _strings;
|
| if (strings == null) _strings = strings = _newHashTable();
|
| @@ -389,16 +397,16 @@ class _CustomHashMap<K, V> extends _HashMap<K, V> {
|
| final _Equality<K> _equals;
|
| final _Hasher<K> _hashCode;
|
| final _Predicate<Object> _validKey;
|
| - _CustomHashMap(this._equals, this._hashCode,
|
| - bool validKey(Object potentialKey))
|
| + _CustomHashMap(
|
| + this._equals, this._hashCode, bool validKey(Object potentialKey))
|
| : _validKey = (validKey != null) ? validKey : ((v) => v is K);
|
|
|
| - V operator[](Object key) {
|
| + V operator [](Object key) {
|
| if (!_validKey(key)) return null;
|
| return super._get(key);
|
| }
|
|
|
| - void operator[]=(K key, V value) {
|
| + void operator []=(K key, V value) {
|
| super._set(key, value);
|
| }
|
|
|
| @@ -489,9 +497,10 @@ class _HashMapKeyIterator<E> implements Iterator<E> {
|
| @patch
|
| class LinkedHashMap<K, V> {
|
| @patch
|
| - factory LinkedHashMap({ bool equals(K key1, K key2),
|
| - int hashCode(K key),
|
| - bool isValidKey(Object potentialKey) }) {
|
| + factory LinkedHashMap(
|
| + {bool equals(K key1, K key2),
|
| + int hashCode(K key),
|
| + bool isValidKey(Object potentialKey)}) {
|
| if (isValidKey == null) {
|
| if (hashCode == null) {
|
| if (equals == null) {
|
| @@ -553,8 +562,8 @@ class _LinkedIdentityHashMap<K, V> extends JsLinkedHashMap<K, V> {
|
| }
|
| }
|
|
|
| -class _Es6LinkedIdentityHashMap<K, V>
|
| - extends _LinkedIdentityHashMap<K, V> implements InternalMap<K, V> {
|
| +class _Es6LinkedIdentityHashMap<K, V> extends _LinkedIdentityHashMap<K, V>
|
| + implements InternalMap<K, V> {
|
| final _map;
|
| int _modifications = 0;
|
|
|
| @@ -566,8 +575,7 @@ class _Es6LinkedIdentityHashMap<K, V>
|
|
|
| Iterable<K> get keys => new _Es6MapIterable<K>(this, true);
|
|
|
| - Iterable<V> get values =>
|
| - new _Es6MapIterable<V>(this, false);
|
| + Iterable<V> get values => new _Es6MapIterable<V>(this, false);
|
|
|
| bool containsKey(Object key) {
|
| return JS('bool', '#.has(#)', _map, key);
|
| @@ -583,11 +591,11 @@ class _Es6LinkedIdentityHashMap<K, V>
|
| });
|
| }
|
|
|
| - V operator[](Object key) {
|
| + V operator [](Object key) {
|
| return JS('var', '#.get(#)', _map, key);
|
| }
|
|
|
| - void operator[]=(K key, V value) {
|
| + void operator []=(K key, V value) {
|
| JS('var', '#.set(#, #)', _map, key, value);
|
| _modified();
|
| }
|
| @@ -717,16 +725,16 @@ class _LinkedCustomHashMap<K, V> extends JsLinkedHashMap<K, V> {
|
| final _Equality<K> _equals;
|
| final _Hasher<K> _hashCode;
|
| final _Predicate<Object> _validKey;
|
| - _LinkedCustomHashMap(this._equals, this._hashCode,
|
| - bool validKey(Object potentialKey))
|
| + _LinkedCustomHashMap(
|
| + this._equals, this._hashCode, bool validKey(Object potentialKey))
|
| : _validKey = (validKey != null) ? validKey : ((v) => v is K);
|
|
|
| - V operator[](Object key) {
|
| + V operator [](Object key) {
|
| if (!_validKey(key)) return null;
|
| return super.internalGet(key);
|
| }
|
|
|
| - void operator[]=(K key, V value) {
|
| + void operator []=(K key, V value) {
|
| super.internalSet(key, value);
|
| }
|
|
|
| @@ -761,9 +769,10 @@ class _LinkedCustomHashMap<K, V> extends JsLinkedHashMap<K, V> {
|
| @patch
|
| class HashSet<E> {
|
| @patch
|
| - factory HashSet({ bool equals(E e1, E e2),
|
| - int hashCode(E e),
|
| - bool isValidKey(Object potentialKey) }) {
|
| + factory HashSet(
|
| + {bool equals(E e1, E e2),
|
| + int hashCode(E e),
|
| + bool isValidKey(Object potentialKey)}) {
|
| if (isValidKey == null) {
|
| if (hashCode == null) {
|
| if (equals == null) {
|
| @@ -1093,8 +1102,8 @@ class _CustomHashSet<E> extends _HashSet<E> {
|
| _Equality<E> _equality;
|
| _Hasher<E> _hasher;
|
| _Predicate<Object> _validKey;
|
| - _CustomHashSet(this._equality, this._hasher,
|
| - bool validKey(Object potentialKey))
|
| + _CustomHashSet(
|
| + this._equality, this._hasher, bool validKey(Object potentialKey))
|
| : _validKey = (validKey != null) ? validKey : ((x) => x is E);
|
|
|
| Set<E> _newSet() => new _CustomHashSet<E>(_equality, _hasher, _validKey);
|
| @@ -1167,9 +1176,10 @@ class _HashSetIterator<E> implements Iterator<E> {
|
| @patch
|
| class LinkedHashSet<E> {
|
| @patch
|
| - factory LinkedHashSet({ bool equals(E e1, E e2),
|
| - int hashCode(E e),
|
| - bool isValidKey(Object potentialKey) }) {
|
| + factory LinkedHashSet(
|
| + {bool equals(E e1, E e2),
|
| + int hashCode(E e),
|
| + bool isValidKey(Object potentialKey)}) {
|
| if (isValidKey == null) {
|
| if (hashCode == null) {
|
| if (equals == null) {
|
| @@ -1355,7 +1365,8 @@ class _LinkedHashSet<E> extends _HashSetBase<E> implements LinkedHashSet<E> {
|
| if (index < 0) return false;
|
| // Use splice to remove the [cell] element at the index and
|
| // unlink it.
|
| - _LinkedHashSetCell/*<E>*/ cell = JS('var', '#.splice(#, 1)[0]', bucket, index);
|
| + _LinkedHashSetCell/*<E>*/ cell =
|
| + JS('var', '#.splice(#, 1)[0]', bucket, index);
|
| _unlinkCell(cell);
|
| return true;
|
| }
|
| @@ -1536,8 +1547,8 @@ class _LinkedCustomHashSet<E> extends _LinkedHashSet<E> {
|
| _Equality<E> _equality;
|
| _Hasher<E> _hasher;
|
| _Predicate<Object> _validKey;
|
| - _LinkedCustomHashSet(this._equality, this._hasher,
|
| - bool validKey(Object potentialKey))
|
| + _LinkedCustomHashSet(
|
| + this._equality, this._hasher, bool validKey(Object potentialKey))
|
| : _validKey = (validKey != null) ? validKey : ((x) => x is E);
|
|
|
| Set<E> _newSet() =>
|
|
|