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

Function invoke

lib/test/angular/1.5.0/angular.js:4590–4609  ·  view source on GitHub ↗
(fn, self, locals, serviceName)

Source from the content-addressed store, hash-verified

4588 }
4589
4590 function invoke(fn, self, locals, serviceName) {
4591 if (typeof locals === 'string') {
4592 serviceName = locals;
4593 locals = null;
4594 }
4595
4596 var args = injectionArgs(fn, locals, serviceName);
4597 if (isArray(fn)) {
4598 fn = fn[fn.length - 1];
4599 }
4600
4601 if (!isClass(fn)) {
4602 // http://jsperf.com/angularjs-invoke-apply-vs-switch
4603 // #5388
4604 return fn.apply(self, args);
4605 } else {
4606 args.unshift(null);
4607 return new (Function.prototype.bind.apply(fn, args))();
4608 }
4609 }
4610
4611
4612 function instantiate(Type, locals, serviceName) {

Callers

nothing calls this directly

Calls 3

injectionArgsFunction · 0.70
isClassFunction · 0.70
isArrayFunction · 0.50

Tested by

no test coverage detected