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

Side by Side Diff: runtime/lib/error.dart

Issue 8294005: Rename class AssertError to AssertionError in the VM (fix issue 119). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 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 | « runtime/lib/error.cc ('k') | runtime/vm/bootstrap_natives.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Errors are created and thrown by DartVM only. 4 // Errors are created and thrown by DartVM only.
5 // Changes here should also be reflected in corelib/error.dart as well 5 // Changes here should also be reflected in corelib/error.dart as well
6 6
7 class AssertError { 7 class AssertionError {
8 factory AssertError._uninstantiable() { 8 factory AssertionError._uninstantiable() {
9 throw const UnsupportedOperationException( 9 throw const UnsupportedOperationException(
10 "AssertError can only be allocated by the VM"); 10 "AssertionError can only be allocated by the VM");
11 } 11 }
12 static throwNew(int assertionStart, int assertionEnd) 12 static throwNew(int assertionStart, int assertionEnd)
13 native "AssertError_throwNew"; 13 native "AssertionError_throwNew";
14 String toString() { 14 String toString() {
15 return "Failed assertion: '$failedAssertion' is not true " + 15 return "Failed assertion: '$failedAssertion' is not true " +
16 "in $url at line $line, column $column."; 16 "in $url at line $line, column $column.";
17 } 17 }
18 final String failedAssertion; 18 final String failedAssertion;
19 final String url; 19 final String url;
20 final int line; 20 final int line;
21 final int column; 21 final int column;
22 } 22 }
23 23
24 class TypeError extends AssertError { 24 class TypeError extends AssertionError {
25 factory TypeError._uninstantiable() { 25 factory TypeError._uninstantiable() {
26 throw const UnsupportedOperationException( 26 throw const UnsupportedOperationException(
27 "TypeError can only be allocated by the VM"); 27 "TypeError can only be allocated by the VM");
28 } 28 }
29 String toString() { 29 String toString() {
30 return "Failed type check: type $srcType is not assignable to type " + 30 return "Failed type check: type $srcType is not assignable to type " +
31 "$dstType of $dstName in $url at line " + 31 "$dstType of $dstName in $url at line " +
32 "$line, column $column."; 32 "$line, column $column.";
33 } 33 }
34 final String srcType; 34 final String srcType;
(...skipping 12 matching lines...) Expand all
47 } 47 }
48 final String url; 48 final String url;
49 final int line; 49 final int line;
50 } 50 }
51 51
52 class InternalError { 52 class InternalError {
53 const InternalError(this._msg); 53 const InternalError(this._msg);
54 String toString() => "InternalError: '${_msg}'"; 54 String toString() => "InternalError: '${_msg}'";
55 final String _msg; 55 final String _msg;
56 } 56 }
OLDNEW
« no previous file with comments | « runtime/lib/error.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698