Index: pkg/smoke/lib/mirrors.dart |
diff --git a/pkg/smoke/lib/mirrors.dart b/pkg/smoke/lib/mirrors.dart |
index ffd815d40cffbdd1a52fc23173b9407d2d1f7676..16e742e57d9a160ef48eb5e83fed4fe317eb9af7 100644 |
--- a/pkg/smoke/lib/mirrors.dart |
+++ b/pkg/smoke/lib/mirrors.dart |
@@ -297,11 +297,16 @@ class _MethodClosure extends Function { |
_MethodClosure(this.receiver, this.methodName); |
- // We shouldn't need to include [call] here, but we do to work around an |
- // analyzer bug (see dartbug.com/16078). Interestingly, if [call] is invoked |
- // with the wrong number of arguments, then noSuchMethod is anyways invoked |
- // instead. |
- call() => invoke(receiver, methodName, const []); |
+ // We shouldn't need to include [call] here, but we do for two reasons: |
+ // * a workaround for an analyzer bug (see dartbug.com/16078). |
+ // * this allows `is` checks to work for functions of 0 through 3 arguments. |
+ // We depend on this in `polymer_expressions/lib/eval.dart` to check whether |
+ // a function is a filter (takes a single argument). |
+ // |
+ // Note: if [call] is invoked with the wrong number of arguments, then |
+ // noSuchMethod is invoked instead, so this declaration mainly affects |
+ // instance-of checks. |
+ call([a, b, c]) => invoke(receiver, methodName, [a, b, c], adjust: true); |
Siggi Cherem (dart-lang)
2014/02/21 03:55:13
technically all we need is call(a) for eval.dart.
|
noSuchMethod(Invocation inv) { |
if (inv.memberName != #call) return null; |