| 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 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * Exception thrown because of non-existing receiver's method. | 35 * Exception thrown because of non-existing receiver's method. |
| 36 */ | 36 */ |
| 37 class NoSuchMethodException implements Exception { | 37 class NoSuchMethodException implements Exception { |
| 38 const NoSuchMethodException(Object this._receiver, | 38 const NoSuchMethodException(Object this._receiver, |
| 39 String this._functionName, | 39 String this._functionName, |
| 40 List this._arguments, | 40 List this._arguments, |
| 41 [List this._existingArgumentNames = null]); | 41 [List existingArgumentNames = null]) : |
| 42 this._existingArgumentNames = existingArgumentNa
mes; |
| 42 | 43 |
| 43 String toString() { | 44 String toString() { |
| 44 StringBuffer sb = new StringBuffer(); | 45 StringBuffer sb = new StringBuffer(); |
| 45 for (int i = 0; i < _arguments.length; i++) { | 46 for (int i = 0; i < _arguments.length; i++) { |
| 46 if (i > 0) { | 47 if (i > 0) { |
| 47 sb.add(", "); | 48 sb.add(", "); |
| 48 } | 49 } |
| 49 sb.add(_arguments[i]); | 50 sb.add(_arguments[i]); |
| 50 } | 51 } |
| 51 if (_existingArgumentNames === null) { | 52 if (_existingArgumentNames === null) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 153 |
| 153 | 154 |
| 154 class UnsupportedOperationException implements Exception { | 155 class UnsupportedOperationException implements Exception { |
| 155 const UnsupportedOperationException(String this._message); | 156 const UnsupportedOperationException(String this._message); |
| 156 String toString() => "UnsupportedOperationException: $_message"; | 157 String toString() => "UnsupportedOperationException: $_message"; |
| 157 final String _message; | 158 final String _message; |
| 158 } | 159 } |
| 159 | 160 |
| 160 | 161 |
| 161 class NotImplementedException implements Exception { | 162 class NotImplementedException implements Exception { |
| 162 const NotImplementedException([String this._message]); | 163 const NotImplementedException([String message]) : this._message = message; |
| 163 String toString() => (this._message !== null | 164 String toString() => (this._message !== null |
| 164 ? "NotImplementedException: $_message" | 165 ? "NotImplementedException: $_message" |
| 165 : "NotImplementedException"); | 166 : "NotImplementedException"); |
| 166 final String _message; | 167 final String _message; |
| 167 } | 168 } |
| 168 | 169 |
| 169 | 170 |
| 170 class IllegalJSRegExpException implements Exception { | 171 class IllegalJSRegExpException implements Exception { |
| 171 const IllegalJSRegExpException(String this._pattern, String this._errmsg); | 172 const IllegalJSRegExpException(String this._pattern, String this._errmsg); |
| 172 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; | 173 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; |
| 173 final String _pattern; | 174 final String _pattern; |
| 174 final String _errmsg; | 175 final String _errmsg; |
| 175 } | 176 } |
| 176 | 177 |
| 177 | 178 |
| 178 class IntegerDivisionByZeroException implements Exception { | 179 class IntegerDivisionByZeroException implements Exception { |
| 179 const IntegerDivisionByZeroException(); | 180 const IntegerDivisionByZeroException(); |
| 180 String toString() => "IntegerDivisionByZeroException"; | 181 String toString() => "IntegerDivisionByZeroException"; |
| 181 } | 182 } |
| OLD | NEW |