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

Unified Diff: tests/language/no_such_method_test.dart

Issue 11339042: 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 | « tests/language/language_dart2js.status ('k') | tests/language/overridden_no_such_method.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/no_such_method_test.dart
diff --git a/tests/language/no_such_method_test.dart b/tests/language/no_such_method_test.dart
index bd41878be69134dd9e80f987829bd0024b7a9772..138df66ea628cc26c15b1b3100b9f65be51c52b3 100644
--- a/tests/language/no_such_method_test.dart
+++ b/tests/language/no_such_method_test.dart
@@ -5,20 +5,22 @@
class NoSuchMethodTest {
- foo({a = 10, b = 20}) {
+ foo([a = 10, b = 20]) {
return (10 * a) + b;
}
- noSuchMethod(InvocationMirror im) {
- Expect.equals("moo", im.memberName);
- Expect.equals(0, im.positionalArguments.length);
- Expect.equals(1, im.namedArguments.length);
- return foo(b:im.namedArguments["b"]);
+ noSuchMethod(String name, List args) {
+ Expect.equals("moo", name);
+ Expect.equals(1, args.length);
+ return foo(args[0]);
}
static testMain() {
var obj = new NoSuchMethodTest();
- Expect.equals(199, obj.moo(b:99)); // obj.NoSuchMethod called here.
+ Expect.equals(1010, obj.moo(b:99)); // obj.NoSuchMethod called here.
+ // After we remove the rest argument and change the signature of
+ // noSuchMethod to be compatible with named arguments, we can expect the
+ // correct value of 199 instead of 1010.
}
}
« no previous file with comments | « tests/language/language_dart2js.status ('k') | tests/language/overridden_no_such_method.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698