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

Side by Side Diff: sdk/lib/core/exceptions.dart

Issue 11365226: Exception no longer an interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | tests/language/ct_const2_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // 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 * Defaults to an implementation that only carries a simple message. 9 * Defaults to an implementation that only carries a simple message.
10 */ 10 */
11 interface Exception default _ExceptionImplementation { 11 abstract class Exception {
12 // TODO(lrn): This should be an abstract class, but we don't yet support 12 const factory Exception([var message]) = _ExceptionImplementation;
13 // redirecting factory constructors.
14 const Exception([var message]);
15 } 13 }
16 14
17 15
18 /** Default implementation of [Exception] which carries a message. */ 16 /** Default implementation of [Exception] which carries a message. */
19 class _ExceptionImplementation implements Exception { 17 class _ExceptionImplementation implements Exception {
20 final message; 18 final message;
21 const _ExceptionImplementation([this.message]); 19 const _ExceptionImplementation([this.message]);
22 String toString() => (message == null) ? "Exception" : "Exception: $message"; 20 String toString() => (message == null) ? "Exception" : "Exception: $message";
23 } 21 }
24 22
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 } 73 }
76 74
77 /** 75 /**
78 * Exception thrown when a runtime error occurs. 76 * Exception thrown when a runtime error occurs.
79 */ 77 */
80 class RuntimeError implements Exception { 78 class RuntimeError implements Exception {
81 final message; 79 final message;
82 RuntimeError(this.message); 80 RuntimeError(this.message);
83 String toString() => "RuntimeError: $message"; 81 String toString() => "RuntimeError: $message";
84 } 82 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | tests/language/ct_const2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698