From 4b8d926062eb4d4483555bdbdec4656f585ab40b Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 26 Mar 2012 12:21:42 -0700 Subject: [PATCH] feat(assertArgFn): should support array annotated fns --- src/Angular.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index 371a56c0366e..b174a54c3b36 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -959,7 +959,11 @@ function assertArg(arg, name, reason) { return arg; } -function assertArgFn(arg, name) { +function assertArgFn(arg, name, acceptArrayAnnotation) { + if (acceptArrayAnnotation && isArray(arg)) { + arg = arg[arg.length - 1]; + } + assertArg(isFunction(arg), name, 'not a function, got ' + (arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg)); return arg;