| Index: runtime/lib/errors_patch.dart
|
| ===================================================================
|
| --- runtime/lib/errors_patch.dart (revision 16582)
|
| +++ runtime/lib/errors_patch.dart (working copy)
|
| @@ -8,3 +8,33 @@
|
| }
|
| }
|
|
|
| +patch class NoSuchMethodError {
|
| + // The compiler emits a call to _throwNew when it cannot resolve a static
|
| + // method at compile time. The receiver is actually the literal class of the
|
| + // unresolved method.
|
| + static void _throwNew(Object receiver,
|
| + String memberName,
|
| + List arguments,
|
| + List argumentNames,
|
| + List existingArgumentNames) {
|
| + int numNamedArguments = argumentNames == null ? 0 : argumentNames.length;
|
| + int numPositionalArguments = arguments == null ? 0 : arguments.length;
|
| + numPositionalArguments -= numNamedArguments;
|
| + List positionalArguments;
|
| + if (numPositionalArguments == 0) {
|
| + positionalArguments = [];
|
| + } else {
|
| + positionalArguments = arguments.getRange(0, numPositionalArguments);
|
| + }
|
| + Map<String, dynamic> namedArguments = new Map<String, dynamic>();
|
| + for (int i = 0; i < numNamedArguments; i++) {
|
| + var arg_value = arguments[numPositionalArguments + i];
|
| + namedArguments[argumentNames[i]] = arg_value;
|
| + }
|
| + throw new NoSuchMethodError(receiver,
|
| + memberName,
|
| + positionalArguments,
|
| + namedArguments,
|
| + existingArgumentNames);
|
| + }
|
| +}
|
|
|