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

Unified Diff: lib/compiler/implementation/lib/errors.dart

Issue 10896007: Expose remaining 'errors' in an unified dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move errors to errors.dart in dart2js. Created 8 years, 4 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
« no previous file with comments | « lib/compiler/implementation/lib/core.dart ('k') | lib/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/errors.dart
diff --git a/lib/compiler/implementation/lib/errors.dart b/lib/compiler/implementation/lib/errors.dart
new file mode 100644
index 0000000000000000000000000000000000000000..319abc9e6538df5d40ae58d057ddbd7bc3704d05
--- /dev/null
+++ b/lib/compiler/implementation/lib/errors.dart
@@ -0,0 +1,29 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class TypeErrorImplementation implements TypeError {
+ final String msg;
+ const TypeErrorImplementation(String this.msg);
+ String toString() => msg;
+}
+
+/** Thrown by the 'as' operator if the cast isn't valid. */
+class CastExceptionImplementation implements CastException {
+ // TODO(lrn): Change actualType and expectedType to "Type" when reified
+ // types are available.
+ final Object actualType;
+ final Object expectedType;
+
+ CastExceptionImplementation(this.actualType, this.expectedType);
+
+ String toString() {
+ return "CastException: Casting value of type $actualType to"
+ " incompatible type $expectedType";
+ }
+}
+
+class FallThroughErrorImplementation implements FallThroughError {
+ const FallThroughErrorImplementation();
+ String toString() => "Switch case fall-through.";
+}
« no previous file with comments | « lib/compiler/implementation/lib/core.dart ('k') | lib/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698