Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Unified Diff: corelib/src/exceptions.dart

Issue 10540048: Implement 'as' operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: corelib/src/exceptions.dart
diff --git a/corelib/src/exceptions.dart b/corelib/src/exceptions.dart
index 3e95797999cb3a90cce1e2ea8a3e4cd1c8b00e35..ddb3042e9e8423311c2cff8cf967a9f520e26435 100644
--- a/corelib/src/exceptions.dart
+++ b/corelib/src/exceptions.dart
@@ -38,7 +38,7 @@ class NoSuchMethodException implements Exception {
const NoSuchMethodException(Object this._receiver,
String this._functionName,
List this._arguments,
- [List existingArgumentNames = null]) :
+ [List existingArgumentNames = null]) :
this._existingArgumentNames = existingArgumentNames;
floitsch 2012/06/25 18:21:09 not your code, but 80chars.
Lasse Reichstein Nielsen 2012/06/26 08:26:03 Done.
String toString() {
@@ -140,6 +140,22 @@ class NullPointerException implements Exception {
}
+class CastException implements Exception {
+ // TODO(lrn): Change actualType and expectedType to "Type" when reified
+ // types are available.
+ final Object actualType;
+ final Object expectedType;
+
+ CastException(this.actualType, this.expectedType);
+ String toString() {
+ return "$exceptionName: Casting value of type $actualType to"
+ " incompatible type $expectedType";
+ }
+
+ String get exceptionName() => "CastException";
+}
+
+
class NoMoreElementsException implements Exception {
const NoMoreElementsException();
String toString() => "NoMoreElementsException";
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/js_helper.dart » ('j') | lib/compiler/implementation/ssa/nodes.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698