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

Unified Diff: runtime/lib/map_patch.dart

Issue 1127533002: Add Map.unmodifiable constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments, update documentation. Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/integers_patch.dart ('k') | sdk/lib/_internal/compiler/js_lib/constant_map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/map_patch.dart
diff --git a/runtime/lib/map_patch.dart b/runtime/lib/map_patch.dart
index e7238281d0ec5fc08c9c208e295e5768380b50b1..682ba0362db7a25accb86deab097cf079442e997 100644
--- a/runtime/lib/map_patch.dart
+++ b/runtime/lib/map_patch.dart
@@ -16,4 +16,8 @@ patch class Map<K, V> {
}
return map;
}
+
+ /* patch */ factory Map.unmodifiable(Map other) {
+ return new UnmodifiableMapView<K, V>(new Map.from(other));
+ }
}
« no previous file with comments | « runtime/lib/integers_patch.dart ('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