MCPcopy Create free account
hub / github.com/angular-ui/ui-router / invoke

Function invoke

test/angular/1.5/angular.js:4757–4776  ·  view source on GitHub ↗
(fn, self, locals, serviceName)

Source from the content-addressed store, hash-verified

4755 }
4756
4757 function invoke(fn, self, locals, serviceName) {
4758 if (typeof locals === 'string') {
4759 serviceName = locals;
4760 locals = null;
4761 }
4762
4763 var args = injectionArgs(fn, locals, serviceName);
4764 if (isArray(fn)) {
4765 fn = fn[fn.length - 1];
4766 }
4767
4768 if (!isClass(fn)) {
4769 // http://jsperf.com/angularjs-invoke-apply-vs-switch
4770 // #5388
4771 return fn.apply(self, args);
4772 } else {
4773 args.unshift(null);
4774 return new (Function.prototype.bind.apply(fn, args))();
4775 }
4776 }
4777
4778
4779 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