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 AssertionErrorImplementation implements AssertionError { | 7 class AssertionErrorImplementation implements AssertionError { |
8 factory AssertionErrorImplementation._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"); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 String toString() => "Unresolved static method: url '$url' line $line " | 100 String toString() => "Unresolved static method: url '$url' line $line " |
101 "pos $column\n$failedResolutionLine\n"; | 101 "pos $column\n$failedResolutionLine\n"; |
102 | 102 |
103 static _throwNew(int token_pos) native "StaticResolutionException_throwNew"; | 103 static _throwNew(int token_pos) native "StaticResolutionException_throwNew"; |
104 | 104 |
105 final String failedResolutionLine; | 105 final String failedResolutionLine; |
106 final String url; | 106 final String url; |
107 final int line; | 107 final int line; |
108 final int column; | 108 final int column; |
109 } | 109 } |
| 110 |
| 111 |
| 112 class AbstractClassInstantiationErrorImplementation |
| 113 implements AbstractClassInstantiationError { |
| 114 |
| 115 factory AbstractClassInstantiationErrorImplementation._uninstantiable() { |
| 116 throw const UnsupportedOperationException( |
| 117 "AbstractClassInstantiationError can only be allocated by the VM"); |
| 118 } |
| 119 |
| 120 static _throwNew(int case_clause_pos, String className) |
| 121 native "AbstractClassInstantiationError_throwNew"; |
| 122 |
| 123 String toString() { |
| 124 return "Cannot instantiate abstract class $className: " |
| 125 "url '$url' line $line"; |
| 126 } |
| 127 |
| 128 final String className; |
| 129 final String url; |
| 130 final int line; |
| 131 } |
OLD | NEW |