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

Unified Diff: runtime/lib/immutable_map.dart

Issue 11235054: Removed IllegalAccessException and UnsupportedOperationException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/immutable_map.dart
diff --git a/runtime/lib/immutable_map.dart b/runtime/lib/immutable_map.dart
index 3901c11a5279fb1e6d0a56deabc3cb069f397fa8..b9d4f93c4ef1966027cbf16ce179879a70ccf139 100644
--- a/runtime/lib/immutable_map.dart
+++ b/runtime/lib/immutable_map.dart
@@ -72,19 +72,19 @@ class ImmutableMap<K, V> implements Map<K, V> {
}
void operator []=(K key, V value) {
- throw const IllegalAccessException();
+ throw new StateError("Cannot set value in unmodifiable Map");
floitsch 2012/10/23 12:50:32 why not const?
Lasse Reichstein Nielsen 2012/10/24 12:32:15 Why const. It's an exception case that should happ
}
V putIfAbsent(K key, V ifAbsent()) {
- throw const IllegalAccessException();
+ throw new StateError("Cannot set value in unmodifiable Map");
}
void clear() {
- throw const IllegalAccessException();
+ throw new StateError("Cannot clear unmodifiable Map");
}
V remove(K key) {
- throw const IllegalAccessException();
+ throw new StateError("Cannot remove from unmodifiable Map");
}
String toString() {

Powered by Google App Engine
This is Rietveld 408576698