| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Exceptions are thrown either by the VM or from Dart code. | 5 // Exceptions are thrown either by the VM or from Dart code. |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Interface implemented by all core library exceptions. | 8 * Interface implemented by all core library exceptions. |
| 9 */ | 9 */ |
| 10 interface Exception default ExceptionImplementation { | 10 interface Exception default ExceptionImplementation { |
| 11 const Exception([var msg]); | 11 const Exception([var msg]); |
| 12 } | 12 } |
| 13 | 13 |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * Exception thrown because of an index outside of the valid range. | 16 * Exception thrown because of an index outside of the valid range. |
| 17 */ | 17 */ |
| 18 class IndexOutOfRangeException implements Exception { | 18 class IndexOutOfRangeException implements Exception { |
| 19 const IndexOutOfRangeException(int this._index); | 19 const IndexOutOfRangeException(this._value); |
| 20 String toString() => "IndexOutOfRangeException: $_index"; | 20 |
| 21 final int _index; | 21 String toString() => "IndexOutOfRangeException: $_value"; |
| 22 |
| 23 final _value; |
| 22 } | 24 } |
| 23 | 25 |
| 24 | 26 |
| 25 /** | 27 /** |
| 26 * Exception thrown because of attempt to modify an immutable object. | 28 * Exception thrown because of attempt to modify an immutable object. |
| 27 */ | 29 */ |
| 28 class IllegalAccessException implements Exception { | 30 class IllegalAccessException implements Exception { |
| 29 const IllegalAccessException(); | 31 const IllegalAccessException(); |
| 30 String toString() => "Attempt to modify an immutable object"; | 32 String toString() => "Attempt to modify an immutable object"; |
| 31 } | 33 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; | 175 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; |
| 174 final String _pattern; | 176 final String _pattern; |
| 175 final String _errmsg; | 177 final String _errmsg; |
| 176 } | 178 } |
| 177 | 179 |
| 178 | 180 |
| 179 class IntegerDivisionByZeroException implements Exception { | 181 class IntegerDivisionByZeroException implements Exception { |
| 180 const IntegerDivisionByZeroException(); | 182 const IntegerDivisionByZeroException(); |
| 181 String toString() => "IntegerDivisionByZeroException"; | 183 String toString() => "IntegerDivisionByZeroException"; |
| 182 } | 184 } |
| OLD | NEW |