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

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

Issue 11712002: Remove NoSuchMethodErrorImplementation class and use NoSuchMethodError from core (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/lib/errors_patch.dart » ('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 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
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 should be removed and the corresponding class in the
95 // core lib should be used.
96 class NoSuchMethodErrorImplementation implements NoSuchMethodError {
97 factory NoSuchMethodErrorImplementation._uninstantiable() {
98 throw new UnsupportedError(
99 "NoSuchMethodError can only be allocated by the VM");
100 }
101
102 String toString() => "No such method: '$functionName', url '$url' line $line "
103 "pos $column\n$failedResolutionLine\n";
104
105 static _throwNew(int call_pos, String functionName)
106 native "NoSuchMethodError_throwNew";
107
108 final String functionName;
109 final String failedResolutionLine;
110 final String url;
111 final int line;
112 final int column;
113 }
114
115
116 class AbstractClassInstantiationErrorImplementation 94 class AbstractClassInstantiationErrorImplementation
117 implements AbstractClassInstantiationError { 95 implements AbstractClassInstantiationError {
118 96
119 factory AbstractClassInstantiationErrorImplementation._uninstantiable() { 97 factory AbstractClassInstantiationErrorImplementation._uninstantiable() {
120 throw new UnsupportedError( 98 throw new UnsupportedError(
121 "AbstractClassInstantiationError can only be allocated by the VM"); 99 "AbstractClassInstantiationError can only be allocated by the VM");
122 } 100 }
123 101
124 static _throwNew(int case_clause_pos, String className) 102 static _throwNew(int case_clause_pos, String className)
125 native "AbstractClassInstantiationError_throwNew"; 103 native "AbstractClassInstantiationError_throwNew";
126 104
127 String toString() { 105 String toString() {
128 return "Cannot instantiate abstract class $className: " 106 return "Cannot instantiate abstract class $className: "
129 "url '$url' line $line"; 107 "url '$url' line $line";
130 } 108 }
131 109
132 final String className; 110 final String className;
133 final String url; 111 final String url;
134 final int line; 112 final int line;
135 } 113 }
OLDNEW
« no previous file with comments | « runtime/lib/error.cc ('k') | runtime/lib/errors_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698