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

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: Created 5 years, 8 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
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));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698