mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
feat(assertArgFn): should support array annotated fns
This commit is contained in:
parent
74c84501ed
commit
4b8d926062
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue