Index: lib/core/errors.dart |
diff --git a/lib/core/errors.dart b/lib/core/errors.dart |
index 20a277eb83f05ee6cb7a646effe2c710ac774149..5d08def130bf5a64c1f2206f133fc91df519ef64 100644 |
--- a/lib/core/errors.dart |
+++ b/lib/core/errors.dart |
@@ -65,6 +65,7 @@ class NoSuchMethodError implements Error { |
final Object _receiver; |
final String _functionName; |
final List _arguments; |
+ final Map<String,Dynamic> _namedArguments; |
floitsch
2012/10/23 13:04:35
String, Dynamic (space)
regis
2012/10/25 02:27:56
dynamic is now lower case.
Lasse Reichstein Nielsen
2012/10/25 06:17:35
I actually have come to prefer it without spaces.
|
final List _existingArgumentNames; |
/** |
@@ -83,16 +84,31 @@ class NoSuchMethodError implements Error { |
const NoSuchMethodError(Object this._receiver, |
String this._functionName, |
List this._arguments, |
+ Map<String,Dynamic> this._namedArguments, |
floitsch
2012/10/23 13:04:35
no need to type. the type comes from the field.
Lasse Reichstein Nielsen
2012/10/25 06:17:35
True. And dynamic is lower-case now.
|
[List existingArgumentNames = null]) |
: this._existingArgumentNames = existingArgumentNames; |
String toString() { |
StringBuffer sb = new StringBuffer(); |
- for (int i = 0; i < _arguments.length; i++) { |
- if (i > 0) { |
- sb.add(", "); |
+ int i = 0; |
+ if (_arguments != null) { |
+ for (; i < _arguments.length; i++) { |
+ if (i > 0) { |
+ sb.add(", "); |
+ } |
+ sb.add(safeToString(_arguments[i])); |
} |
- sb.add(safeToString(_arguments[i])); |
+ } |
+ if (_namedArguments != null) { |
+ _namedArguments.forEach((String key, var value) { |
+ if (i > 0) { |
+ sb.add(", "); |
+ } |
+ sb.add(key); |
+ sb.add(": "); |
+ sb.add(safeToString(value)); |
+ i++; |
+ }); |
} |
if (_existingArgumentNames === null) { |
return "NoSuchMethodError : method not found: '$_functionName'\n" |