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

Commit 4b8d926

Browse files
committed
feat(assertArgFn): should support array annotated fns
1 parent 74c8450 commit 4b8d926

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Angular.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,11 @@ function assertArg(arg, name, reason) {
959959
return arg;
960960
}
961961

962-
function assertArgFn(arg, name) {
962+
function assertArgFn(arg, name, acceptArrayAnnotation) {
963+
if (acceptArrayAnnotation && isArray(arg)) {
964+
arg = arg[arg.length - 1];
965+
}
966+
963967
assertArg(isFunction(arg), name, 'not a function, got ' +
964968
(arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
965969
return arg;

0 commit comments

Comments
 (0)