OLD | NEW |
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 AssertionError { |
8 factory AssertionError._uninstantiable() { | 8 factory AssertionError._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 AssertionError { |
25 factory TypeError._uninstantiable() { | 25 factory TypeError._uninstantiable() { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 final String _msg; | 67 final String _msg; |
68 } | 68 } |
69 | 69 |
70 | 70 |
71 class StaticResolutionException implements Exception { | 71 class StaticResolutionException implements Exception { |
72 factory StaticResolutionException._uninstantiable() { | 72 factory StaticResolutionException._uninstantiable() { |
73 throw const UnsupportedOperationException( | 73 throw const UnsupportedOperationException( |
74 "StaticResolutionException can only be allocated by the VM"); | 74 "StaticResolutionException can only be allocated by the VM"); |
75 } | 75 } |
76 | 76 |
77 String toString() => "Unresolved static method: url '$url' line $line " + | 77 String toString() => "Unresolved static method: url '$url' line $line " |
78 "pos $column\n$failedResolutionLine\n"; | 78 "pos $column\n$failedResolutionLine\n"; |
79 | 79 |
80 static _throwNew(int token_pos) native "StaticResolutionException_throwNew"; | 80 static _throwNew(int token_pos) native "StaticResolutionException_throwNew"; |
81 | 81 |
82 final String failedResolutionLine; | 82 final String failedResolutionLine; |
83 final String url; | 83 final String url; |
84 final int line; | 84 final int line; |
85 final int column; | 85 final int column; |
86 } | 86 } |
OLD | NEW |