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

Side by Side Diff: lib/compiler/implementation/lib/mock.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: Make all implementations implement, not extend, the exposed type. Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/lib/js_helper.dart ('k') | runtime/lib/error.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 // 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 TypeError extends AssertionError { 9 class TypeErrorImplementation implements TypeError {
Mads Ager (google) 2012/08/28 16:01:46 How about putting these in errors.dart. That will
10 final String msg; 10 final String msg;
11 const TypeError(String this.msg); 11 const TypeErrorImplementation(String this.msg);
12 String toString() => msg; 12 String toString() => msg;
13 } 13 }
14 14
15 /** Thrown by the 'as' operator if the cast isn't valid. */ 15 /** Thrown by the 'as' operator if the cast isn't valid. */
16 class CastException implements TypeError { 16 class CastExceptionImplementation implements CastException {
17 // TODO(lrn): Change actualType and expectedType to "Type" when reified 17 // TODO(lrn): Change actualType and expectedType to "Type" when reified
18 // types are available. 18 // types are available.
19 final Object actualType; 19 final Object actualType;
20 final Object expectedType; 20 final Object expectedType;
21 21
22 CastException(this.actualType, this.expectedType); 22 CastExceptionImplementation(this.actualType, this.expectedType);
23 23
24 String toString() { 24 String toString() {
25 return "CastException: Casting value of type $actualType to" 25 return "CastException: Casting value of type $actualType to"
26 " incompatible type $expectedType"; 26 " incompatible type $expectedType";
27 } 27 }
28 } 28 }
29 29
30 class FallThroughError { 30 class FallThroughError {
31 const FallThroughError(); 31 const FallThroughError();
32 String toString() => "Switch case fall-through."; 32 String toString() => "Switch case fall-through.";
(...skipping 17 matching lines...) Expand all
50 // TODO(ahe): Not sure ByteArray belongs in the core library. 50 // TODO(ahe): Not sure ByteArray belongs in the core library.
51 interface Uint8List extends List default _InternalByteArray { 51 interface Uint8List extends List default _InternalByteArray {
52 Uint8List(int length); 52 Uint8List(int length);
53 } 53 }
54 54
55 class _InternalByteArray { 55 class _InternalByteArray {
56 factory Uint8List(int length) { 56 factory Uint8List(int length) {
57 throw new UnsupportedOperationException("new Uint8List($length)"); 57 throw new UnsupportedOperationException("new Uint8List($length)");
58 } 58 }
59 } 59 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/js_helper.dart ('k') | runtime/lib/error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698