| 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 class AssertionError implements Error { | 9 class AssertionError implements Error { |
| 10 } | 10 } |
| 11 | 11 |
| 12 class TypeError implements AssertionError { | 12 class TypeError implements AssertionError { |
| 13 } | 13 } |
| 14 | 14 |
| 15 // TODO(lrn): Rename to CastError according to specification. | 15 class CastError implements Error { |
| 16 class CastException implements Error { | |
| 17 } | 16 } |
| 18 | 17 |
| 19 /** | 18 /** |
| 20 * Error thrown when a function is passed an unacceptable argument. | 19 * Error thrown when a function is passed an unacceptable argument. |
| 21 */ | 20 */ |
| 22 class ArgumentError implements Error { | 21 class ArgumentError implements Error { |
| 23 final message; | 22 final message; |
| 24 | 23 |
| 25 /** The [message] describes the erroneous argument. */ | 24 /** The [message] describes the erroneous argument. */ |
| 26 const ArgumentError([this.message = ""]); | 25 const ArgumentError([this.message = ""]); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 .replaceAll('\n', '${backslash}n') | 119 .replaceAll('\n', '${backslash}n') |
| 121 .replaceAll('\r', '${backslash}r') | 120 .replaceAll('\r', '${backslash}r') |
| 122 .replaceAll('"', '$backslash"'); | 121 .replaceAll('"', '$backslash"'); |
| 123 return '"$escaped"'; | 122 return '"$escaped"'; |
| 124 } | 123 } |
| 125 return _objectToString(object); | 124 return _objectToString(object); |
| 126 } | 125 } |
| 127 | 126 |
| 128 external static _objectToString(Object object); | 127 external static _objectToString(Object object); |
| 129 } | 128 } |
| OLD | NEW |