| OLD | NEW |
| 1 part of dart._internal; | 1 part of dart._internal; |
| 2 abstract class FixedLengthListMixin<E> {void set length(int newLength) { | 2 abstract class FixedLengthListMixin<E> {void set length(int newLength) { |
| 3 throw new UnsupportedError("Cannot change the length of a fixed-length list"); | 3 throw new UnsupportedError("Cannot change the length of a fixed-length list"); |
| 4 } | 4 } |
| 5 void add(E value) { | 5 void add(E value) { |
| 6 throw new UnsupportedError("Cannot add to a fixed-length list"); | 6 throw new UnsupportedError("Cannot add to a fixed-length list"); |
| 7 } | 7 } |
| 8 void insert(int index, E value) { | 8 void insert(int index, E value) { |
| 9 throw new UnsupportedError("Cannot add to a fixed-length list"); | 9 throw new UnsupportedError("Cannot add to a fixed-length list"); |
| 10 } | 10 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 class _ListIndicesIterable extends ListIterable<int> {List _backedList; | 102 class _ListIndicesIterable extends ListIterable<int> {List _backedList; |
| 103 _ListIndicesIterable(this._backedList); | 103 _ListIndicesIterable(this._backedList); |
| 104 int get length => _backedList.length; | 104 int get length => _backedList.length; |
| 105 int elementAt(int index) { | 105 int elementAt(int index) { |
| 106 RangeError.checkValidIndex(index, this); | 106 RangeError.checkValidIndex(index, this); |
| 107 return index; | 107 return index; |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 class ListMapView<E> implements Map<int, E> {List<E> _values; | 110 class ListMapView<E> implements Map<int, E> {List<E> _values; |
| 111 ListMapView(this._values); | 111 ListMapView(this._values); |
| 112 E operator [](int key) => containsKey(key) ? _values[key] : null; | 112 E operator [](Object key) => containsKey(key) ? _values[key] : null; |
| 113 int get length => _values.length; | 113 int get length => _values.length; |
| 114 Iterable<E> get values => new SubListIterable<E>(_values, 0, null); | 114 Iterable<E> get values => new SubListIterable<E>(_values, 0, null); |
| 115 Iterable<int> get keys => new _ListIndicesIterable(_values); | 115 Iterable<int> get keys => new _ListIndicesIterable(_values); |
| 116 bool get isEmpty => _values.isEmpty; | 116 bool get isEmpty => _values.isEmpty; |
| 117 bool get isNotEmpty => _values.isNotEmpty; | 117 bool get isNotEmpty => _values.isNotEmpty; |
| 118 bool containsValue(Object value) => _values.contains(value); | 118 bool containsValue(Object value) => _values.contains(value); |
| 119 bool containsKey(int key) => key is int && key >= 0 && key < length; | 119 bool containsKey(Object key) => key is int && key >= 0 && key < length; |
| 120 void forEach(void f(int key, E value)) { | 120 void forEach(void f(int key, E value)) { |
| 121 int length = _values.length; | 121 int length = _values.length; |
| 122 for (int i = 0; i < length; i++) { | 122 for (int i = 0; i < length; i++) { |
| 123 f(i, _values[i]); | 123 f(i, _values[i]); |
| 124 if (length != _values.length) { | 124 if (length != _values.length) { |
| 125 throw new ConcurrentModificationError(_values); | 125 throw new ConcurrentModificationError(_values); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 void operator []=(int key, E value) { | 129 void operator []=(int key, E value) { |
| 130 throw new UnsupportedError("Cannot modify an unmodifiable map"); | 130 throw new UnsupportedError("Cannot modify an unmodifiable map"); |
| 131 } | 131 } |
| 132 E putIfAbsent(int key, E ifAbsent()) { | 132 E putIfAbsent(int key, E ifAbsent()) { |
| 133 throw new UnsupportedError("Cannot modify an unmodifiable map"); | 133 throw new UnsupportedError("Cannot modify an unmodifiable map"); |
| 134 } | 134 } |
| 135 E remove(int key) { | 135 E remove(Object key) { |
| 136 throw new UnsupportedError("Cannot modify an unmodifiable map"); | 136 throw new UnsupportedError("Cannot modify an unmodifiable map"); |
| 137 } | 137 } |
| 138 void clear() { | 138 void clear() { |
| 139 throw new UnsupportedError("Cannot modify an unmodifiable map"); | 139 throw new UnsupportedError("Cannot modify an unmodifiable map"); |
| 140 } | 140 } |
| 141 void addAll(Map<int, E> other) { | 141 void addAll(Map<int, E> other) { |
| 142 throw new UnsupportedError("Cannot modify an unmodifiable map"); | 142 throw new UnsupportedError("Cannot modify an unmodifiable map"); |
| 143 } | 143 } |
| 144 String toString() => Maps.mapToString(this); | 144 String toString() => Maps.mapToString(this); |
| 145 } | 145 } |
| 146 class ReversedListIterable<E> extends ListIterable<E> {Iterable<E> _source; | 146 class ReversedListIterable<E> extends ListIterable<E> {Iterable<E> _source; |
| 147 ReversedListIterable(this._source); | 147 ReversedListIterable(this._source); |
| 148 int get length => _source.length; | 148 int get length => _source.length; |
| 149 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); | 149 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); |
| 150 } | 150 } |
| 151 abstract class UnmodifiableListError {static UnsupportedError add() => new Unsu
pportedError("Cannot add to unmodifiable List"); | 151 abstract class UnmodifiableListError {static UnsupportedError add() => new Unsu
pportedError("Cannot add to unmodifiable List"); |
| 152 static UnsupportedError change() => new UnsupportedError("Cannot change the con
tent of an unmodifiable List"); | 152 static UnsupportedError change() => new UnsupportedError("Cannot change the con
tent of an unmodifiable List"); |
| 153 static UnsupportedError length() => new UnsupportedError("Cannot change length
of unmodifiable List"); | 153 static UnsupportedError length() => new UnsupportedError("Cannot change length
of unmodifiable List"); |
| 154 static UnsupportedError remove() => new UnsupportedError("Cannot remove from un
modifiable List"); | 154 static UnsupportedError remove() => new UnsupportedError("Cannot remove from un
modifiable List"); |
| 155 } | 155 } |
| 156 abstract class NonGrowableListError {static UnsupportedError add() => new Unsup
portedError("Cannot add to non-growable List"); | 156 abstract class NonGrowableListError {static UnsupportedError add() => new Unsup
portedError("Cannot add to non-growable List"); |
| 157 static UnsupportedError length() => new UnsupportedError("Cannot change length
of non-growable List"); | 157 static UnsupportedError length() => new UnsupportedError("Cannot change length
of non-growable List"); |
| 158 static UnsupportedError remove() => new UnsupportedError("Cannot remove from no
n-growable List"); | 158 static UnsupportedError remove() => new UnsupportedError("Cannot remove from no
n-growable List"); |
| 159 } | 159 } |
| 160 external List makeListFixedLength(List growableList) ; | 160 external List makeListFixedLength(List growableList) ; |
| OLD | NEW |