Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
|
jjb
2012/02/02 18:36:25
Update copyright please.
| |
| 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]); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 class ObjectNotClosureException implements Exception { | 67 class ObjectNotClosureException implements Exception { |
| 68 const ObjectNotClosureException(); | 68 const ObjectNotClosureException(); |
| 69 String toString() => "Object is not closure"; | 69 String toString() => "Object is not closure"; |
| 70 } | 70 } |
| 71 | 71 |
| 72 | 72 |
| 73 class IllegalArgumentException implements Exception { | 73 class IllegalArgumentException implements Exception { |
| 74 const IllegalArgumentException([args = ""]) : _args = args; | 74 const IllegalArgumentException([arg = ""]) : _arg = arg; |
| 75 String toString() => "Illegal argument(s): $_args"; | 75 String toString() => "Illegal argument(s): $_arg"; |
| 76 final String _args; | 76 final _arg; |
|
jjb
2012/02/02 18:36:25
This is a fine stopgap. In the long run, we need:
| |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 class OutOfMemoryException implements Exception { | 80 class OutOfMemoryException implements Exception { |
| 81 const OutOfMemoryException(); | 81 const OutOfMemoryException(); |
| 82 String toString() => "Out of Memory"; | 82 String toString() => "Out of Memory"; |
| 83 } | 83 } |
| 84 | 84 |
| 85 | 85 |
| 86 class StackOverflowException implements Exception { | 86 class StackOverflowException implements Exception { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; | 138 String toString() => "IllegalJSRegExpException: '$_pattern' '$_errmsg'"; |
| 139 final String _pattern; | 139 final String _pattern; |
| 140 final String _errmsg; | 140 final String _errmsg; |
| 141 } | 141 } |
| 142 | 142 |
| 143 | 143 |
| 144 class IntegerDivisionByZeroException implements Exception { | 144 class IntegerDivisionByZeroException implements Exception { |
| 145 const IntegerDivisionByZeroException(); | 145 const IntegerDivisionByZeroException(); |
| 146 String toString() => "IntegerDivisionByZeroException"; | 146 String toString() => "IntegerDivisionByZeroException"; |
| 147 } | 147 } |
| OLD | NEW |