| 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 // Mocks of things that Leg cannot read directly. | 5 // Mocks of things that Leg cannot read directly. |
| 6 | 6 |
| 7 // TODO(ahe): Remove this file. | 7 // TODO(ahe): Remove this file. |
| 8 | 8 |
| 9 class AssertionError {} | 9 class AssertionError {} |
| 10 class TypeError extends AssertionError {} | 10 class TypeError extends AssertionError {} |
| 11 | 11 |
| 12 class FallThroughError { | 12 class FallThroughError { |
| 13 const FallThroughError(); | 13 const FallThroughError(); |
| 14 String toString() => "Switch case fall-through."; | 14 String toString() => "Switch case fall-through."; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // TODO(ahe): VM specfic exception? | 17 // TODO(ahe): VM specfic exception? |
| 18 class InternalError { | 18 class InternalError { |
| 19 const InternalError(this._msg); | 19 const InternalError(this._msg); |
| 20 String toString() => "InternalError: '${_msg}'"; | 20 String toString() => "InternalError: '${_msg}'"; |
| 21 final String _msg; | 21 final String _msg; |
| 22 } | 22 } |
| 23 | 23 |
| 24 // TODO(ahe): VM specfic exception? | 24 // TODO(ahe): VM specfic exception? |
| 25 class StaticResolutionException implements Exception {} | 25 class StaticResolutionException implements Exception {} |
| 26 | 26 |
| 27 void assert(condition) {} | 27 void assert(condition) {} |
| 28 | 28 |
| 29 // TODO(ahe): Not sure ByteArray belongs in the core library. |
| 29 interface ByteArray extends List default _InternalByteArray { | 30 interface ByteArray extends List default _InternalByteArray { |
| 30 ByteArray(int length); | 31 ByteArray(int length); |
| 31 } | 32 } |
| 32 | 33 |
| 33 class _InternalByteArray { | 34 class _InternalByteArray { |
| 34 factory _InternalByteArray(int length) { | 35 factory _InternalByteArray(int length) { |
| 35 throw new UnsupportedOperationException("new ByteArray($length)"); | 36 throw new UnsupportedOperationException("new ByteArray($length)"); |
| 36 } | 37 } |
| 37 } | 38 } |
| 39 |
| 40 // TODO(ahe): This definitely does not belong in the core library. |
| 41 void exit(int exitCode) { |
| 42 throw new UnsupportedOperationException("exit($exitCode)"); |
| 43 } |
| OLD | NEW |