Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/collection_patch.dart

Issue 1025573005: Move implementation from IterableBase to Iterable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove extra "static" on helper functions. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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, JsLinkedHashMap, 8 fillLiteralMap, InternalMap, NoInline, NoThrows, patch, JsLinkedHashMap,
9 LinkedHashMapCell, LinkedHashMapKeyIterable, LinkedHashMapKeyIterator; 9 LinkedHashMapCell, LinkedHashMapKeyIterable, LinkedHashMapKeyIterator;
10 10
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 int length = JS('int', '#.length', bucket); 420 int length = JS('int', '#.length', bucket);
421 for (int i = 0; i < length; i += 2) { 421 for (int i = 0; i < length; i += 2) {
422 if (_equals(JS('var', '#[#]', bucket, i), key)) return i; 422 if (_equals(JS('var', '#[#]', bucket, i), key)) return i;
423 } 423 }
424 return -1; 424 return -1;
425 } 425 }
426 426
427 String toString() => Maps.mapToString(this); 427 String toString() => Maps.mapToString(this);
428 } 428 }
429 429
430 class HashMapKeyIterable<E> extends IterableBase<E> 430 class HashMapKeyIterable<E> extends Iterable<E>
431 implements EfficientLength { 431 implements EfficientLength {
432 final _map; 432 final _map;
433 HashMapKeyIterable(this._map); 433 HashMapKeyIterable(this._map);
434 434
435 int get length => _map._length; 435 int get length => _map._length;
436 bool get isEmpty => _map._length == 0; 436 bool get isEmpty => _map._length == 0;
437 437
438 Iterator<E> get iterator { 438 Iterator<E> get iterator {
439 return new HashMapKeyIterator<E>(_map, _map._computeKeys()); 439 return new HashMapKeyIterator<E>(_map, _map._computeKeys());
440 } 440 }
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 } else if (_cell == null) { 1458 } else if (_cell == null) {
1459 _current = null; 1459 _current = null;
1460 return false; 1460 return false;
1461 } else { 1461 } else {
1462 _current = _cell._element; 1462 _current = _cell._element;
1463 _cell = _cell._next; 1463 _cell = _cell._next;
1464 return true; 1464 return true;
1465 } 1465 }
1466 } 1466 }
1467 } 1467 }
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | sdk/lib/_internal/compiler/js_lib/constant_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698