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

Unified Diff: pkg/smoke/lib/mirrors.dart

Issue 173003006: Use smoke in polymer and polymer_expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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/polymer_expressions/lib/src/mirrors.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « pkg/polymer_expressions/lib/src/mirrors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698