Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 typedef void DebugCallback(String methodName, var arg1, var arg2); | 5 typedef void DebugCallback(String methodName, var arg1, var arg2); |
| 6 | 6 |
| 7 class DebugMap<K, V> implements Map<K, V> { | 7 class DebugMap<K, V> implements Map<K, V> { |
| 8 final Map<K, V> map; | 8 final Map<K, V> map; |
| 9 DebugCallback indexSetCallBack; | 9 DebugCallback indexSetCallBack; |
| 10 DebugCallback putIfAbsentCallBack; | 10 DebugCallback putIfAbsentCallBack; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 bool get isNotEmpty => map.isNotEmpty; | 64 bool get isNotEmpty => map.isNotEmpty; |
| 65 } | 65 } |
| 66 | 66 |
| 67 class DebugIterable<E> implements Iterable<E> { | 67 class DebugIterable<E> implements Iterable<E> { |
| 68 final Iterable<E> iterable; | 68 final Iterable<E> iterable; |
| 69 | 69 |
| 70 DebugIterable(this.iterable); | 70 DebugIterable(this.iterable); |
| 71 | 71 |
| 72 Iterator<E> get iterator => iterable.iterator; | 72 Iterator<E> get iterator => iterable.iterator; |
| 73 | 73 |
| 74 Iterable<T> map<T>( T f(E element)) => iterable.map(f); | 74 Iterable<T> map<T>(T f(E element)) => iterable.map(f); |
|
Siggi Cherem (dart-lang)
2017/01/11 22:57:47
:)
| |
| 75 | 75 |
| 76 Iterable<E> where(bool test(E element)) => iterable.where(test); | 76 Iterable<E> where(bool test(E element)) => iterable.where(test); |
| 77 | 77 |
| 78 Iterable<T> expand<T>(Iterable<T> f(E element)) => iterable.expand(f); | 78 Iterable<T> expand<T>(Iterable<T> f(E element)) => iterable.expand(f); |
| 79 | 79 |
| 80 bool contains(Object element) => iterable.contains(element); | 80 bool contains(Object element) => iterable.contains(element); |
| 81 | 81 |
| 82 void forEach(void f(E element)) => iterable.forEach(f); | 82 void forEach(void f(E element)) => iterable.forEach(f); |
| 83 | 83 |
| 84 E reduce(E combine(E value, E element)) => iterable.reduce(combine); | 84 E reduce(E combine(E value, E element)) => iterable.reduce(combine); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 check(element, '$methodName: '); | 327 check(element, '$methodName: '); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void check(var element, [String text = '']) { | 330 void check(var element, [String text = '']) { |
| 331 String elementType = '${element.runtimeType}'; | 331 String elementType = '${element.runtimeType}'; |
| 332 if (runtimeTypes.contains(elementType)) return; | 332 if (runtimeTypes.contains(elementType)) return; |
| 333 throw '$name: $text$elementType' | 333 throw '$name: $text$elementType' |
| 334 '${showObjects ? ' ($element)' : ''}'; | 334 '${showObjects ? ' ($element)' : ''}'; |
| 335 } | 335 } |
| 336 } | 336 } |
| OLD | NEW |