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

Unified Diff: sdk/lib/_internal/lib/constant_map.dart

Issue 59463004: Fix the generic type of Map.values for map literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/lib/constant_map.dart
diff --git a/sdk/lib/_internal/lib/constant_map.dart b/sdk/lib/_internal/lib/constant_map.dart
index 5c68379cce310cdf542aeaa08c82822cb2a7ba25..0fabc0bd31170c04d65014c774b42a9e1560ffd1 100644
--- a/sdk/lib/_internal/lib/constant_map.dart
+++ b/sdk/lib/_internal/lib/constant_map.dart
@@ -55,7 +55,7 @@ class ConstantStringMap<K, V> extends ConstantMap<K, V>
}
Iterable<V> get values {
- return _keys.map((key) => this[key]);
+ return new MappedIterable<K, V>(_keys, (key) => this[key]);
}
}
@@ -92,7 +92,9 @@ class GeneralConstantMap<K, V> extends ConstantMap<K, V> {
// have not been defined when constants are created.
Map<K, V> _getMap() {
if (JS('bool', r'!this.$map')) {
- JS('', r'this.$map = #', makeConstantMap(_jsData));
+ Map backingMap =
+ new LinkedHashMap<K, V>(equals: identical, hashCode: objectHashCode);
+ JS('', r'this.$map = #', fillLiteralMap(_jsData, backingMap));
}
return JS('Map', r'this.$map');
}

Powered by Google App Engine
This is Rietveld 408576698