Chromium Code Reviews| Index: runtime/lib/errors_patch.dart |
| =================================================================== |
| --- runtime/lib/errors_patch.dart (revision 22181) |
| +++ runtime/lib/errors_patch.dart (working copy) |
| @@ -23,7 +23,8 @@ |
| numPositionalArguments -= numNamedArguments; |
| List positionalArguments; |
| if (numPositionalArguments == 0) { |
| - positionalArguments = []; |
| + // Differ between no arguments specified and 0 arguments. |
|
regis
2013/04/30 19:07:10
When is _throwNew called with unspecified argument
srdjan
2013/04/30 21:46:52
Adding comments: TODO(srdjan): This can currently
|
| + positionalArguments = argumentNames == null ? null : []; |
| } else { |
| positionalArguments = arguments.sublist(0, numPositionalArguments); |
| } |
| @@ -79,8 +80,13 @@ |
| msg = "The null object does not have a $type_str '$_memberName'" |
| "$args_message."; |
| } else { |
| - msg = "Class '${_receiver.runtimeType}' has no instance $type_str " |
| - "'$_memberName'$args_message."; |
| + if (_receiver is Function) { |
| + msg = "Closure call with mismatched arguments: " |
| + "function '$_memberName'"; |
| + } else { |
| + msg = "Class '${_receiver.runtimeType}' has no instance $type_str " |
| + "'$_memberName'$args_message."; |
| + } |
| } |
| break; |
| } |
| @@ -94,7 +100,7 @@ |
| break; |
| } |
| case _InvocationMirror._TOP_LEVEL: { |
| - msg = "No top-level $type_str '$_memberName' declared."; |
| + msg = "No top-level $type_str '$_memberName'$args_message declared."; |
| break; |
| } |
| } |
| @@ -104,7 +110,10 @@ |
| /* patch */ String toString() { |
| StringBuffer actual_buf = new StringBuffer(); |
| int i = 0; |
| - if (_arguments != null) { |
| + if (_arguments == null) { |
| + // Actual arguments unknown. |
|
regis
2013/04/30 19:07:10
ditto
srdjan
2013/04/30 21:46:52
Adding TODO(regis): Remove once arguments are pass
|
| + actual_buf.write("..."); |
|
regis
2013/04/30 19:07:10
Same question.
srdjan
2013/04/30 21:46:52
Answered above.
|
| + } else { |
| for (; i < _arguments.length; i++) { |
| if (i > 0) { |
| actual_buf.write(", "); |