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

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

Issue 214723002: Remove unmodifiable map wrappers that could instead use UnmodifiableMapView. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix missing import, increment mirror function count. Created 6 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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/util.dart ('k') | sdk/lib/core/uri.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/js_mirrors.dart
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index 1036bfdb25540a67d5e265feb3ca4b8c3aefdfed..b67e6b43f3e8be0fcb93a8e7a3512e99bb44bc17 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -7,7 +7,8 @@ library dart._js_mirrors;
import 'dart:async';
import 'dart:collection' show
- UnmodifiableListView;
+ UnmodifiableListView,
+ UnmodifiableMapView;
import 'dart:mirrors';
@@ -2835,45 +2836,6 @@ class NoSuchStaticMethodError extends Error implements NoSuchMethodError {
}
}
-// Copied from package "unmodifiable_collection".
-// TODO(14314): Move to dart:collection.
-class UnmodifiableMapView<K, V> implements Map<K, V> {
- Map<K, V> _source;
- UnmodifiableMapView(Map<K, V> source) : _source = source;
-
- static void _throw() {
- throw new UnsupportedError("Cannot modify an unmodifiable Map");
- }
-
- int get length => _source.length;
-
- bool get isEmpty => _source.isEmpty;
-
- bool get isNotEmpty => _source.isNotEmpty;
-
- V operator [](K key) => _source[key];
-
- bool containsKey(K key) => _source.containsKey(key);
-
- bool containsValue(V value) => _source.containsValue(value);
-
- void forEach(void f(K key, V value)) => _source.forEach(f);
-
- Iterable<K> get keys => _source.keys;
-
- Iterable<V> get values => _source.values;
-
- void operator []=(K key, V value) => _throw();
-
- V putIfAbsent(K key, V ifAbsent()) { _throw(); }
-
- void addAll(Map<K, V> other) => _throw();
-
- V remove(K key) { _throw(); }
-
- void clear() => _throw();
-}
-
Symbol getSymbol(String name, LibraryMirror library) {
if (_isPublicSymbol(name)) {
return new _symbol_dev.Symbol.validated(name);
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/util.dart ('k') | sdk/lib/core/uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698