Chromium Code Reviews| 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 class Error { | 5 class Error { |
| 6 const Error(); | 6 const Error(); |
| 7 } | 7 } |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Error thrown by the runtime system when an assert statement fails. | 10 * Error thrown by the runtime system when an assert statement fails. |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 | 35 |
| 36 String toString() { | 36 String toString() { |
| 37 if (message != null) { | 37 if (message != null) { |
| 38 return "Illegal argument(s): $message"; | 38 return "Illegal argument(s): $message"; |
| 39 } | 39 } |
| 40 return "Illegal argument(s)"; | 40 return "Illegal argument(s)"; |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * Exception thrown because of an index outside of the valid range. | |
| 46 */ | |
| 47 class RangeError extends ArgumentError { | |
| 48 RangeError(int value) : super("Value of of range: $value"); | |
|
floitsch
2012/10/25 14:31:38
Value out of range
Make it a 'num' ?
Lasse Reichstein Nielsen
2012/10/26 11:30:22
Done.
| |
| 49 } | |
| 50 | |
| 51 | |
| 52 /** | |
| 45 * Temporary backwards compatibility class. | 53 * Temporary backwards compatibility class. |
| 46 * | 54 * |
| 47 * Removed when users have had time to change to using [ArgumentError]. | 55 * Removed when users have had time to change to using [ArgumentError]. |
| 48 */ | 56 */ |
| 49 class IllegalArgumentException extends ArgumentError { | 57 class IllegalArgumentException extends ArgumentError { |
| 50 const IllegalArgumentException([argument = ""]) : super(argument); | 58 const IllegalArgumentException([argument = ""]) : super(argument); |
| 51 } | 59 } |
| 52 | 60 |
| 53 /** | 61 /** |
| 54 * Error thrown when control reaches the end of a switch case. | 62 * Error thrown when control reaches the end of a switch case. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 | 182 |
| 175 class OutOfMemoryError implements Error { | 183 class OutOfMemoryError implements Error { |
| 176 const OutOfMemoryError(); | 184 const OutOfMemoryError(); |
| 177 String toString() => "Out of Memory"; | 185 String toString() => "Out of Memory"; |
| 178 } | 186 } |
| 179 | 187 |
| 180 class StackOverflowError implements Error { | 188 class StackOverflowError implements Error { |
| 181 const StackOverflowError(); | 189 const StackOverflowError(); |
| 182 String toString() => "Stack Overflow"; | 190 String toString() => "Stack Overflow"; |
| 183 } | 191 } |
| OLD | NEW |