| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 const NullPointerException([this.functionName, this.arguments = const []]); | 124 const NullPointerException([this.functionName, this.arguments = const []]); |
| 125 String toString() { | 125 String toString() { |
| 126 if (functionName == null) { | 126 if (functionName == null) { |
| 127 return exceptionName; | 127 return exceptionName; |
| 128 } else { | 128 } else { |
| 129 return "$exceptionName : method: '$functionName'\n" | 129 return "$exceptionName : method: '$functionName'\n" |
| 130 "Receiver: null\n" | 130 "Receiver: null\n" |
| 131 "Arguments: $arguments"; | 131 "Arguments: $arguments"; |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 String get exceptionName() => "NullPointerException"; | 135 String get exceptionName() => "NullPointerException"; |
| 136 | 136 |
| 137 final String functionName; | 137 final String functionName; |
| 138 final List arguments; | 138 final List arguments; |
| 139 } | 139 } |
| 140 | 140 |
| 141 | 141 |
| 142 class NoMoreElementsException implements Exception { | 142 class NoMoreElementsException implements Exception { |
| 143 const NoMoreElementsException(); | 143 const NoMoreElementsException(); |
| 144 String toString() => "NoMoreElementsException"; | 144 String toString() => "NoMoreElementsException"; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 169 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; | 169 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; |
| 170 final String _pattern; | 170 final String _pattern; |
| 171 final String _errmsg; | 171 final String _errmsg; |
| 172 } | 172 } |
| 173 | 173 |
| 174 | 174 |
| 175 class IntegerDivisionByZeroException implements Exception { | 175 class IntegerDivisionByZeroException implements Exception { |
| 176 const IntegerDivisionByZeroException(); | 176 const IntegerDivisionByZeroException(); |
| 177 String toString() => "IntegerDivisionByZeroException"; | 177 String toString() => "IntegerDivisionByZeroException"; |
| 178 } | 178 } |
| OLD | NEW |