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 new UnsupportedError( | 9 throw new UnsupportedError( |
10 "AssertionError can only be allocated by the VM"); | 10 "AssertionError can only be allocated by the VM"); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 final int line; | 84 final int line; |
85 } | 85 } |
86 | 86 |
87 class InternalError { | 87 class InternalError { |
88 const InternalError(this._msg); | 88 const InternalError(this._msg); |
89 String toString() => "InternalError: '${_msg}'"; | 89 String toString() => "InternalError: '${_msg}'"; |
90 final String _msg; | 90 final String _msg; |
91 } | 91 } |
92 | 92 |
93 | 93 |
94 // TODO(regis): This class will change once mirrors are available. | 94 // TODO(regis): This class should be removed and the corresponding class in the |
| 95 // core lib should be used. |
95 class NoSuchMethodErrorImplementation implements NoSuchMethodError { | 96 class NoSuchMethodErrorImplementation implements NoSuchMethodError { |
96 factory NoSuchMethodErrorImplementation._uninstantiable() { | 97 factory NoSuchMethodErrorImplementation._uninstantiable() { |
97 throw new UnsupportedError( | 98 throw new UnsupportedError( |
98 "NoSuchMethodError can only be allocated by the VM"); | 99 "NoSuchMethodError can only be allocated by the VM"); |
99 } | 100 } |
100 | 101 |
101 String toString() => "No such method: '$functionName', url '$url' line $line " | 102 String toString() => "No such method: '$functionName', url '$url' line $line " |
102 "pos $column\n$failedResolutionLine\n"; | 103 "pos $column\n$failedResolutionLine\n"; |
103 | 104 |
104 static _throwNew(int call_pos, String functionName) | 105 static _throwNew(int call_pos, String functionName) |
(...skipping 20 matching lines...) Expand all Loading... |
125 | 126 |
126 String toString() { | 127 String toString() { |
127 return "Cannot instantiate abstract class $className: " | 128 return "Cannot instantiate abstract class $className: " |
128 "url '$url' line $line"; | 129 "url '$url' line $line"; |
129 } | 130 } |
130 | 131 |
131 final String className; | 132 final String className; |
132 final String url; | 133 final String url; |
133 final int line; | 134 final int line; |
134 } | 135 } |
OLD | NEW |