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

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

Issue 19819003: Make reflective invocations raise NoSuchMethodErrors in the cases where non-reflective invocations … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | runtime/lib/mirrors.cc » ('j') | runtime/lib/mirrors.cc » ('J')
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 // TODO(11680): implement stackTrace on Error. 10 // TODO(11680): implement stackTrace on Error.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 actual_buf.write(", "); 136 actual_buf.write(", ");
137 } 137 }
138 actual_buf.write(key); 138 actual_buf.write(key);
139 actual_buf.write(": "); 139 actual_buf.write(": ");
140 actual_buf.write(Error.safeToString(value)); 140 actual_buf.write(Error.safeToString(value));
141 i++; 141 i++;
142 }); 142 });
143 } 143 }
144 var args_mismatch = _existingArgumentNames != null; 144 var args_mismatch = _existingArgumentNames != null;
145 StringBuffer msg_buf = new StringBuffer(_developerMessage(args_mismatch)); 145 StringBuffer msg_buf = new StringBuffer(_developerMessage(args_mismatch));
146 String receiver_str = Error.safeToString(_receiver); 146 String receiver_str;
147 if ("Type: class '::'" == receiver_str) { 147 var level = (_invocation_type >> _InvocationMirror._CALL_SHIFT) &
148 _InvocationMirror._CALL_MASK;
149 if ( level == _InvocationMirror._TOP_LEVEL) {
148 receiver_str = "top-level"; 150 receiver_str = "top-level";
151 } else {
152 receiver_str = Error.safeToString(_receiver);
149 } 153 }
150 if (!args_mismatch) { 154 if (!args_mismatch) {
151 msg_buf.write( 155 msg_buf.write(
152 "NoSuchMethodError : method not found: '$_memberName'\n" 156 "NoSuchMethodError : method not found: '$_memberName'\n"
153 "Receiver: $receiver_str\n" 157 "Receiver: $receiver_str\n"
154 "Arguments: [$actual_buf]"); 158 "Arguments: [$actual_buf]");
155 } else { 159 } else {
156 String actualParameters = actual_buf.toString(); 160 String actualParameters = actual_buf.toString();
157 StringBuffer formal_buf = new StringBuffer(); 161 StringBuffer formal_buf = new StringBuffer();
158 for (int i = 0; i < _existingArgumentNames.length; i++) { 162 for (int i = 0; i < _existingArgumentNames.length; i++) {
(...skipping 13 matching lines...) Expand all
172 return msg_buf.toString(); 176 return msg_buf.toString();
173 } 177 }
174 } 178 }
175 179
176 class _FiftyThreeBitOverflowError extends Error { 180 class _FiftyThreeBitOverflowError extends Error {
177 final Object _value; 181 final Object _value;
178 182
179 _FiftyThreeBitOverflowError(this._value); 183 _FiftyThreeBitOverflowError(this._value);
180 String toString() => "53-bit Overflow: $_value"; 184 String toString() => "53-bit Overflow: $_value";
181 } 185 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/mirrors.cc » ('j') | runtime/lib/mirrors.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698