| Index: runtime/lib/array.dart
|
| diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
|
| index 3a2ca485d551e1d886f26de2768de933dd0e938f..28a8c2ecb433daa56d56d7f672d6d7d1e9ef8cb5 100644
|
| --- a/runtime/lib/array.dart
|
| +++ b/runtime/lib/array.dart
|
| @@ -25,7 +25,7 @@ class _ObjectArray<E> implements List<E> {
|
| native "ObjectArray_copyFromObjectArray";
|
|
|
| E removeAt(int index) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot remove element of a non-extendable array");
|
| }
|
|
|
| @@ -41,12 +41,12 @@ class _ObjectArray<E> implements List<E> {
|
| }
|
|
|
| void removeRange(int start, int length) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot remove range of a non-extendable array");
|
| }
|
|
|
| void insertRange(int start, int length, [E initialValue = null]) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot insert range in a non-extendable array");
|
| }
|
|
|
| @@ -110,7 +110,7 @@ class _ObjectArray<E> implements List<E> {
|
| }
|
|
|
| void add(E element) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot add to a non-extendable array");
|
| }
|
|
|
| @@ -119,22 +119,22 @@ class _ObjectArray<E> implements List<E> {
|
| }
|
|
|
| void addAll(Collection<E> elements) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot add to a non-extendable array");
|
| }
|
|
|
| void clear() {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot clear a non-extendable array");
|
| }
|
|
|
| void set length(int length) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot change the length of a non-extendable array");
|
| }
|
|
|
| E removeLast() {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot remove in a non-extendable array");
|
| }
|
|
|
| @@ -154,41 +154,41 @@ class _ObjectArray<E> implements List<E> {
|
| class _ImmutableArray<E> implements List<E> {
|
|
|
| factory _ImmutableArray._uninstantiable() {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "ImmutableArray can only be allocated by the VM");
|
| }
|
|
|
| E operator [](int index) native "ObjectArray_getIndexed";
|
|
|
| void operator []=(int index, E value) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot modify an immutable array");
|
| }
|
|
|
| int get length native "ObjectArray_getLength";
|
|
|
| E removeAt(int index) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot modify an immutable array");
|
| }
|
|
|
| void copyFrom(List src, int srcStart, int dstStart, int count) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot modify an immutable array");
|
| }
|
|
|
| void setRange(int start, int length, List<E> from, [int startFrom = 0]) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot modify an immutable array");
|
| }
|
|
|
| void removeRange(int start, int length) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot remove range of an immutable array");
|
| }
|
|
|
| void insertRange(int start, int length, [E initialValue = null]) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot insert range in an immutable array");
|
| }
|
|
|
| @@ -235,7 +235,7 @@ class _ImmutableArray<E> implements List<E> {
|
| }
|
|
|
| void sort([Comparator<E> compare]) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot modify an immutable array");
|
| }
|
|
|
| @@ -257,7 +257,7 @@ class _ImmutableArray<E> implements List<E> {
|
| }
|
|
|
| void add(E element) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot add to an immutable array");
|
| }
|
|
|
| @@ -266,22 +266,22 @@ class _ImmutableArray<E> implements List<E> {
|
| }
|
|
|
| void addAll(Collection<E> elements) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot add to an immutable array");
|
| }
|
|
|
| void clear() {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot clear an immutable array");
|
| }
|
|
|
| void set length(int length) {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot change the length of an immutable array");
|
| }
|
|
|
| E removeLast() {
|
| - throw const UnsupportedOperationException(
|
| + throw new StateError(
|
| "Cannot remove in a non-extendable array");
|
| }
|
|
|
|
|