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

Unified Diff: sdk/lib/collection/maps.dart

Issue 2722613004: Add documentation for mutating operations of unmodifiable maps. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/maps.dart
diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart
index c928287bd31b9351cddcff3e2566cf716ab59a87..d8dfcfccc9eb7af1c341fc9fd423a8c193d65d49 100644
--- a/sdk/lib/collection/maps.dart
+++ b/sdk/lib/collection/maps.dart
@@ -156,18 +156,23 @@ class _MapBaseValueIterator<K, V> implements Iterator<V> {
* Mixin that overrides mutating map operations with implementations that throw.
*/
abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {
+ /** This operation is not supported by an unmodifiable map. */
void operator[]=(K key, V value) {
throw new UnsupportedError("Cannot modify unmodifiable map");
}
+ /** This operation is not supported by an unmodifiable map. */
void addAll(Map<K, V> other) {
throw new UnsupportedError("Cannot modify unmodifiable map");
}
+ /** This operation is not supported by an unmodifiable map. */
void clear() {
throw new UnsupportedError("Cannot modify unmodifiable map");
}
+ /** This operation is not supported by an unmodifiable map. */
V remove(Object key) {
throw new UnsupportedError("Cannot modify unmodifiable map");
}
+ /** This operation is not supported by an unmodifiable map. */
V putIfAbsent(K key, V ifAbsent()) {
throw new UnsupportedError("Cannot modify unmodifiable map");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698