Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
feat(assertArgFn): should support array annotated fns
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Mar 26, 2012
1 parent 74c8450 commit 4b8d926
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4b8d926

Please sign in to comment.