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

Unified Diff: pkg/unittest/mock.dart

Issue 11336011: Revert "Change signature of noSuchMethod to take an InvocationMirror." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/pkg.status ('k') | runtime/lib/invocation_mirror_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/mock.dart
diff --git a/pkg/unittest/mock.dart b/pkg/unittest/mock.dart
index 377e70209a6b96cc8d6408f55c0e0bac081de398..f743d330473f095584375509b7cd92109c25ff11 100644
--- a/pkg/unittest/mock.dart
+++ b/pkg/unittest/mock.dart
@@ -1276,17 +1276,10 @@ class Mock {
* return value. If we find no [Behavior] to apply an exception is
* thrown.
*/
- noSuchMethod(InvocationMirror invocation) {
- String method = invocation.methodName;
- // Remove this when InvocationMirror works correctly.
- if (method.startsWith("get:")) method = method.substring(4);
-
- if (invocation.isGetter) {
- method = 'get $method';
+ noSuchMethod(String method, List args) {
+ if (method.startsWith('get:')) {
+ method = 'get ${method.substring(4)}';
}
- List args = invocation.positionalArguments;
- // TODO: Handle named arguments too.
-
bool matchedMethodName = false;
MatchState matchState = new MatchState();
for (String k in _behaviors.keys) {
« no previous file with comments | « pkg/pkg.status ('k') | runtime/lib/invocation_mirror_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698