| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Patch file for dart:collection classes. | 5 // Patch file for dart:collection classes. |
| 6 import 'dart:_foreign_helper' show JS; | 6 import 'dart:_foreign_helper' show JS; |
| 7 import 'dart:_js_helper' show | 7 import 'dart:_js_helper' show |
| 8 fillLiteralMap, InternalMap, NoInline, NoThrows, patch; | 8 fillLiteralMap, InternalMap, NoInline, NoThrows, patch, JsLinkedHashMap; |
| 9 | 9 |
| 10 @patch | 10 @patch |
| 11 class HashMap<K, V> { | 11 class HashMap<K, V> { |
| 12 @patch | 12 @patch |
| 13 factory HashMap({ bool equals(K key1, K key2), | 13 factory HashMap({ bool equals(K key1, K key2), |
| 14 int hashCode(K key), | 14 int hashCode(K key), |
| 15 bool isValidKey(Object potentialKey) }) { | 15 bool isValidKey(Object potentialKey) }) { |
| 16 if (isValidKey == null) { | 16 if (isValidKey == null) { |
| 17 if (hashCode == null) { | 17 if (hashCode == null) { |
| 18 if (equals == null) { | 18 if (equals == null) { |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 485 |
| 486 @patch | 486 @patch |
| 487 class LinkedHashMap<K, V> { | 487 class LinkedHashMap<K, V> { |
| 488 @patch | 488 @patch |
| 489 factory LinkedHashMap({ bool equals(K key1, K key2), | 489 factory LinkedHashMap({ bool equals(K key1, K key2), |
| 490 int hashCode(K key), | 490 int hashCode(K key), |
| 491 bool isValidKey(Object potentialKey) }) { | 491 bool isValidKey(Object potentialKey) }) { |
| 492 if (isValidKey == null) { | 492 if (isValidKey == null) { |
| 493 if (hashCode == null) { | 493 if (hashCode == null) { |
| 494 if (equals == null) { | 494 if (equals == null) { |
| 495 return new _LinkedHashMap<K, V>(); | 495 return new JsLinkedHashMap<K, V>.es6(); |
| 496 } | 496 } |
| 497 hashCode = _defaultHashCode; | 497 hashCode = _defaultHashCode; |
| 498 } else { | 498 } else { |
| 499 if (identical(identityHashCode, hashCode) && | 499 if (identical(identityHashCode, hashCode) && |
| 500 identical(identical, equals)) { | 500 identical(identical, equals)) { |
| 501 return new _LinkedIdentityHashMap<K, V>(); | 501 return new _LinkedIdentityHashMap<K, V>(); |
| 502 } | 502 } |
| 503 if (equals == null) { | 503 if (equals == null) { |
| 504 equals = _defaultEquals; | 504 equals = _defaultEquals; |
| 505 } | 505 } |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1831 } else if (_cell == null) { | 1831 } else if (_cell == null) { |
| 1832 _current = null; | 1832 _current = null; |
| 1833 return false; | 1833 return false; |
| 1834 } else { | 1834 } else { |
| 1835 _current = _cell._element; | 1835 _current = _cell._element; |
| 1836 _cell = _cell._next; | 1836 _cell = _cell._next; |
| 1837 return true; | 1837 return true; |
| 1838 } | 1838 } |
| 1839 } | 1839 } |
| 1840 } | 1840 } |
| OLD | NEW |