mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-14 09:43:12 +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;
|
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 ' +
|
assertArg(isFunction(arg), name, 'not a function, got ' +
|
||||||
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
|
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
|
||||||
return arg;
|
return arg;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue