MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / annotate

Function annotate

lib/test/angular/1.5.0/angular.js:3831–3864  ·  view source on GitHub ↗
(fn, strictDi, name)

Source from the content-addressed store, hash-verified

3829}
3830
3831function annotate(fn, strictDi, name) {
3832 var $inject,
3833 argDecl,
3834 last;
3835
3836 if (typeof fn === 'function') {
3837 if (!($inject = fn.$inject)) {
3838 $inject = [];
3839 if (fn.length) {
3840 if (strictDi) {
3841 if (!isString(name) || !name) {
3842 name = fn.name || anonFn(fn);
3843 }
3844 throw $injectorMinErr('strictdi',
3845 '{0} is not using explicit annotation and cannot be invoked in strict mode', name);
3846 }
3847 argDecl = extractArgs(fn);
3848 forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
3849 arg.replace(FN_ARG, function(all, underscore, name) {
3850 $inject.push(name);
3851 });
3852 });
3853 }
3854 fn.$inject = $inject;
3855 }
3856 } else if (isArray(fn)) {
3857 last = fn.length - 1;
3858 assertArgFn(fn[last], 'fn');
3859 $inject = fn.slice(0, last);
3860 } else {
3861 assertArgFn(fn, 'fn', true);
3862 }
3863 return $inject;
3864}
3865
3866///////////////////////////////////////
3867

Callers

nothing calls this directly

Calls 6

isStringFunction · 0.70
anonFnFunction · 0.70
extractArgsFunction · 0.70
forEachFunction · 0.70
assertArgFnFunction · 0.70
isArrayFunction · 0.50

Tested by

no test coverage detected