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

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

Issue 10882056: Unify AssertionError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move AssertionError to errors.dart. 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 | « runtime/lib/error.cc ('k') | runtime/vm/debugger.cc » ('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 // 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 AssertionError { 7 class AssertionErrorImplementation extends AssertionError {
8 factory AssertionError._uninstantiable() { 8 factory AssertionErrorImplementation._uninstantiable() {
9 throw const UnsupportedOperationException( 9 throw const UnsupportedOperationException(
10 "AssertionError 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 "AssertionError_throwNew"; 13 native "AssertionError_throwNew";
14 String toString() { 14 String toString() {
15 return "'$url': Failed assertion: line $line pos $column: " 15 return "'$url': Failed assertion: line $line pos $column: "
16 "'$failedAssertion' is not true."; 16 "'$failedAssertion' is not true.";
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 AssertionError { 24 class TypeError extends AssertionErrorImplementation {
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 static _throwNew(int location, 29 static _throwNew(int location,
30 Object src_value, 30 Object src_value,
31 String dst_type_name, 31 String dst_type_name,
32 String dst_name, 32 String dst_name,
33 String malformed_error) 33 String malformed_error)
34 native "TypeError_throwNew"; 34 native "TypeError_throwNew";
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 String toString() => "Unresolved static method: url '$url' line $line " 96 String toString() => "Unresolved static method: url '$url' line $line "
97 "pos $column\n$failedResolutionLine\n"; 97 "pos $column\n$failedResolutionLine\n";
98 98
99 static _throwNew(int token_pos) native "StaticResolutionException_throwNew"; 99 static _throwNew(int token_pos) native "StaticResolutionException_throwNew";
100 100
101 final String failedResolutionLine; 101 final String failedResolutionLine;
102 final String url; 102 final String url;
103 final int line; 103 final int line;
104 final int column; 104 final int column;
105 } 105 }
OLDNEW
« no previous file with comments | « runtime/lib/error.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698