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

Function annotate

lib/test/angular/1.6.7/angular.js:4247–4280  ·  view source on GitHub ↗
(fn, strictDi, name)

Source from the content-addressed store, hash-verified

4245}
4246
4247function annotate(fn, strictDi, name) {
4248 var $inject,
4249 argDecl,
4250 last;
4251
4252 if (typeof fn === 'function') {
4253 if (!($inject = fn.$inject)) {
4254 $inject = [];
4255 if (fn.length) {
4256 if (strictDi) {
4257 if (!isString(name) || !name) {
4258 name = fn.name || anonFn(fn);
4259 }
4260 throw $injectorMinErr('strictdi',
4261 '{0} is not using explicit annotation and cannot be invoked in strict mode', name);
4262 }
4263 argDecl = extractArgs(fn);
4264 forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
4265 arg.replace(FN_ARG, function(all, underscore, name) {
4266 $inject.push(name);
4267 });
4268 });
4269 }
4270 fn.$inject = $inject;
4271 }
4272 } else if (isArray(fn)) {
4273 last = fn.length - 1;
4274 assertArgFn(fn[last], 'fn');
4275 $inject = fn.slice(0, last);
4276 } else {
4277 assertArgFn(fn, 'fn', true);
4278 }
4279 return $inject;
4280}
4281
4282///////////////////////////////////////
4283

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