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

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

Issue 13982018: - Print "top-level" instead of "class '::'" in (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | 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 4
5 patch class Error { 5 patch class Error {
6 /* patch */ static String _objectToString(Object object) { 6 /* patch */ static String _objectToString(Object object) {
7 return Object._toString(object); 7 return Object._toString(object);
8 } 8 }
9 } 9 }
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 actual_buf.write(", "); 118 actual_buf.write(", ");
119 } 119 }
120 actual_buf.write(key); 120 actual_buf.write(key);
121 actual_buf.write(": "); 121 actual_buf.write(": ");
122 actual_buf.write(Error.safeToString(value)); 122 actual_buf.write(Error.safeToString(value));
123 i++; 123 i++;
124 }); 124 });
125 } 125 }
126 var args_mismatch = _existingArgumentNames != null; 126 var args_mismatch = _existingArgumentNames != null;
127 StringBuffer msg_buf = new StringBuffer(_developerMessage(args_mismatch)); 127 StringBuffer msg_buf = new StringBuffer(_developerMessage(args_mismatch));
128 String receiver_str = Error.safeToString(_receiver);
129 if ("Type: class '::'" == receiver_str) {
130 receiver_str = "top-level";
131 }
128 if (!args_mismatch) { 132 if (!args_mismatch) {
129 msg_buf.write( 133 msg_buf.write(
130 "NoSuchMethodError : method not found: '$_memberName'\n" 134 "NoSuchMethodError : method not found: '$_memberName'\n"
131 "Receiver: ${Error.safeToString(_receiver)}\n" 135 "Receiver: $receiver_str\n"
132 "Arguments: [$actual_buf]"); 136 "Arguments: [$actual_buf]");
133 } else { 137 } else {
134 String actualParameters = actual_buf.toString(); 138 String actualParameters = actual_buf.toString();
135 StringBuffer formal_buf = new StringBuffer(); 139 StringBuffer formal_buf = new StringBuffer();
136 for (int i = 0; i < _existingArgumentNames.length; i++) { 140 for (int i = 0; i < _existingArgumentNames.length; i++) {
137 if (i > 0) { 141 if (i > 0) {
138 formal_buf.write(", "); 142 formal_buf.write(", ");
139 } 143 }
140 formal_buf.write(_existingArgumentNames[i]); 144 formal_buf.write(_existingArgumentNames[i]);
141 } 145 }
142 String formalParameters = formal_buf.toString(); 146 String formalParameters = formal_buf.toString();
143 msg_buf.write( 147 msg_buf.write(
144 "NoSuchMethodError: incorrect number of arguments passed to " 148 "NoSuchMethodError: incorrect number of arguments passed to "
145 "method named '$_memberName'\n" 149 "method named '$_memberName'\n"
146 "Receiver: ${Error.safeToString(_receiver)}\n" 150 "Receiver: $receiver_str\n"
147 "Tried calling: $_memberName($actualParameters)\n" 151 "Tried calling: $_memberName($actualParameters)\n"
148 "Found: $_memberName($formalParameters)"); 152 "Found: $_memberName($formalParameters)");
149 } 153 }
150 return msg_buf.toString(); 154 return msg_buf.toString();
151 } 155 }
152 } 156 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698