MCPcopy
hub / github.com/angular-ui/ui-router / invoke

Function invoke

test/angular/1.7/angular.js:5129–5148  ·  view source on GitHub ↗
(fn, self, locals, serviceName)

Source from the content-addressed store, hash-verified

5127 }
5128
5129 function invoke(fn, self, locals, serviceName) {
5130 if (typeof locals === 'string') {
5131 serviceName = locals;
5132 locals = null;
5133 }
5134
5135 var args = injectionArgs(fn, locals, serviceName);
5136 if (isArray(fn)) {
5137 fn = fn[fn.length - 1];
5138 }
5139
5140 if (!isClass(fn)) {
5141 // http://jsperf.com/angularjs-invoke-apply-vs-switch
5142 // #5388
5143 return fn.apply(self, args);
5144 } else {
5145 args.unshift(null);
5146 return new (Function.prototype.bind.apply(fn, args))();
5147 }
5148 }
5149
5150
5151 function instantiate(Type, locals, serviceName) {

Callers

nothing calls this directly

Calls 3

isArrayFunction · 0.85
injectionArgsFunction · 0.70
isClassFunction · 0.70

Tested by

no test coverage detected