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

Side by Side Diff: test/dart_codegen/expect/collection/hash_map.dart

Issue 961493003: don't run dart gen on JS patch code (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 part of dart.collection; 1 part of dart.collection;
2 2
3 bool _defaultEquals(a, b) => a == b; 3 bool _defaultEquals(a, b) => a == b;
4 int _defaultHashCode(a) => DDC$RT.cast(a.hashCode, dynamic, int, "CastGeneral", 4 int _defaultHashCode(a) => DDC$RT.cast(a.hashCode, dynamic, int, "CastGeneral",
5 """line 10, column 28 of dart:collection/hash_map.dart: """, 5 """line 10, column 28 of dart:collection/hash_map.dart: """,
6 a.hashCode is int, true); 6 a.hashCode is int, true);
7 typedef bool _Equality<K>(K a, K b); 7 typedef bool _Equality<K>(K a, K b);
8 typedef int _Hasher<K>(K object); 8 typedef int _Hasher<K>(K object);
9 abstract class HashMap<K, V> implements Map<K, V> { 9 abstract class HashMap<K, V> implements Map<K, V> {
10 factory HashMap({bool equals(K key1, K key2), int hashCode(K key), 10 external factory HashMap({bool equals(K key1, K key2), int hashCode(K key),
11 bool isValidKey(potentialKey)}) { 11 bool isValidKey(potentialKey)});
12 if (isValidKey == null) { 12 external factory HashMap.identity();
13 if (hashCode == null) {
14 if (equals == null) {
15 return new _HashMap<K, V>();
16 }
17 hashCode = _defaultHashCode;
18 } else {
19 if (identical(identityHashCode, hashCode) &&
20 identical(identical, equals)) {
21 return new _IdentityHashMap<K, V>();
22 }
23 if (equals == null) {
24 equals = _defaultEquals;
25 }
26 }
27 } else {
28 if (hashCode == null) {
29 hashCode = _defaultHashCode;
30 }
31 if (equals == null) {
32 equals = _defaultEquals;
33 }
34 }
35 return new _CustomHashMap<K, V>(equals, hashCode, isValidKey);
36 }
37 factory HashMap.identity() = _IdentityHashMap<K, V>;
38 factory HashMap.from(Map other) { 13 factory HashMap.from(Map other) {
39 HashMap<K, V> result = new HashMap<K, V>(); 14 HashMap<K, V> result = new HashMap<K, V>();
40 other.forEach((k, v) { 15 other.forEach((k, v) {
41 result[k] = DDC$RT.cast(v, dynamic, V, "CastGeneral", 16 result[k] = DDC$RT.cast(v, dynamic, V, "CastGeneral",
42 """line 112, column 40 of dart:collection/hash_map.dart: """, v is V, 17 """line 87, column 40 of dart:collection/hash_map.dart: """, v is V,
43 false); 18 false);
44 }); 19 });
45 return result; 20 return result;
46 } 21 }
47 factory HashMap.fromIterable(Iterable iterable, 22 factory HashMap.fromIterable(Iterable iterable,
48 {K key(element), V value(element)}) { 23 {K key(element), V value(element)}) {
49 HashMap<K, V> map = new HashMap<K, V>(); 24 HashMap<K, V> map = new HashMap<K, V>();
50 Maps._fillMapWithMappedIterable(map, iterable, key, value); 25 Maps._fillMapWithMappedIterable(map, iterable, key, value);
51 return map; 26 return map;
52 } 27 }
53 factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) { 28 factory HashMap.fromIterables(Iterable<K> keys, Iterable<V> values) {
54 HashMap<K, V> map = new HashMap<K, V>(); 29 HashMap<K, V> map = new HashMap<K, V>();
55 Maps._fillMapWithIterables(map, keys, values); 30 Maps._fillMapWithIterables(map, keys, values);
56 return map; 31 return map;
57 } 32 }
58 } 33 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/collection/collection ('k') | test/dart_codegen/expect/collection/hash_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698