| Index: runtime/lib/error.dart
|
| ===================================================================
|
| --- runtime/lib/error.dart (revision 9048)
|
| +++ runtime/lib/error.dart (working copy)
|
| @@ -48,6 +48,25 @@
|
| final String malformedError;
|
| }
|
|
|
| +class CastException extends TypeError {
|
| + factory CastException._uninstantiable() {
|
| + throw const UnsupportedOperationException(
|
| + "CastException can only be allocated by the VM");
|
| + }
|
| + // A CastException is allocated by TypeError._throwNew() with "type cast" as
|
| + // dst_name.
|
| + String toString() {
|
| + String str = (malformedError != null) ? malformedError : "";
|
| + if ((dstName != null) && (dstName.length > 0)) {
|
| + str = "${str}type '$srcType' is not a subtype of "
|
| + "type '$dstType' in type cast.";
|
| + } else {
|
| + str = "${str}malformed type used in type cast.";
|
| + }
|
| + return str;
|
| + }
|
| +}
|
| +
|
| class FallThroughError {
|
| factory FallThroughError._uninstantiable() {
|
| throw const UnsupportedOperationException(
|
|
|