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

Side by Side Diff: pkg/compiler/lib/src/helpers/debug_collection.dart

Issue 2413233002: Change Set.difference API to accept Set<Object>. (Closed)
Patch Set: Also update a few subclasses. Created 4 years, 2 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
« no previous file with comments | « CHANGELOG.md ('k') | pkg/compiler/lib/src/helpers/expensive_set.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 void removeWhere(bool test(E element)) => set.removeWhere(test); 254 void removeWhere(bool test(E element)) => set.removeWhere(test);
255 255
256 void retainWhere(bool test(E element)) => set.retainWhere(test); 256 void retainWhere(bool test(E element)) => set.retainWhere(test);
257 257
258 bool containsAll(Iterable<Object> other) => set.containsAll(other); 258 bool containsAll(Iterable<Object> other) => set.containsAll(other);
259 259
260 Set<E> intersection(Set<Object> other) => set.intersection(other); 260 Set<E> intersection(Set<Object> other) => set.intersection(other);
261 261
262 Set<E> union(Set<E> other) => set.union(other); 262 Set<E> union(Set<E> other) => set.union(other);
263 263
264 Set<E> difference(Set<E> other) => set.difference(other); 264 Set<E> difference(Set<Object> other) => set.difference(other);
265 265
266 void clear() => set.clear(); 266 void clear() => set.clear();
267 267
268 Set<E> toSet() => set.toSet(); 268 Set<E> toSet() => set.toSet();
269 } 269 }
270 270
271 /// Throws an exception if the runtime type of [object] is not in 271 /// Throws an exception if the runtime type of [object] is not in
272 /// [runtimeTypes]. 272 /// [runtimeTypes].
273 /// 273 ///
274 /// Use this to gradually build the set of actual runtime values of [object] 274 /// Use this to gradually build the set of actual runtime values of [object]
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 check(element, '$methodName: '); 328 check(element, '$methodName: ');
329 } 329 }
330 330
331 void check(var element, [String text = '']) { 331 void check(var element, [String text = '']) {
332 String elementType = '${element.runtimeType}'; 332 String elementType = '${element.runtimeType}';
333 if (runtimeTypes.contains(elementType)) return; 333 if (runtimeTypes.contains(elementType)) return;
334 throw '$name: $text$elementType' 334 throw '$name: $text$elementType'
335 '${showObjects ? ' ($element)' : ''}'; 335 '${showObjects ? ' ($element)' : ''}';
336 } 336 }
337 } 337 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | pkg/compiler/lib/src/helpers/expensive_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698