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, NoSideEffects, NoThrows, patch, | 8 fillLiteralMap, InternalMap, NoInline, NoSideEffects, NoThrows, patch, |
9 JsLinkedHashMap, LinkedHashMapCell, LinkedHashMapKeyIterable, | 9 JsLinkedHashMap, LinkedHashMapCell, LinkedHashMapKeyIterable, |
10 LinkedHashMapKeyIterator; | 10 LinkedHashMapKeyIterator; |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 for (int i = 0; i < length; i += 2) { | 423 for (int i = 0; i < length; i += 2) { |
424 if (_equals(JS('var', '#[#]', bucket, i), key)) return i; | 424 if (_equals(JS('var', '#[#]', bucket, i), key)) return i; |
425 } | 425 } |
426 return -1; | 426 return -1; |
427 } | 427 } |
428 | 428 |
429 String toString() => Maps.mapToString(this); | 429 String toString() => Maps.mapToString(this); |
430 } | 430 } |
431 | 431 |
432 class HashMapKeyIterable<E> extends Iterable<E> | 432 class HashMapKeyIterable<E> extends Iterable<E> |
433 implements EfficientLengthIterable<E> { | 433 implements EfficientLength { |
434 final _map; | 434 final _map; |
435 HashMapKeyIterable(this._map); | 435 HashMapKeyIterable(this._map); |
436 | 436 |
437 int get length => _map._length; | 437 int get length => _map._length; |
438 bool get isEmpty => _map._length == 0; | 438 bool get isEmpty => _map._length == 0; |
439 | 439 |
440 Iterator<E> get iterator { | 440 Iterator<E> get iterator { |
441 return new HashMapKeyIterator<E>(_map, _map._computeKeys()); | 441 return new HashMapKeyIterator<E>(_map, _map._computeKeys()); |
442 } | 442 } |
443 | 443 |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1474 } else if (_cell == null) { | 1474 } else if (_cell == null) { |
1475 _current = null; | 1475 _current = null; |
1476 return false; | 1476 return false; |
1477 } else { | 1477 } else { |
1478 _current = _cell._element; | 1478 _current = _cell._element; |
1479 _cell = _cell._next; | 1479 _cell = _cell._next; |
1480 return true; | 1480 return true; |
1481 } | 1481 } |
1482 } | 1482 } |
1483 } | 1483 } |
OLD | NEW |