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

Function invoke

lib/test/angular/1.8.0/angular.js:5194–5213  ·  view source on GitHub ↗
(fn, self, locals, serviceName)

Source from the content-addressed store, hash-verified

5192 }
5193
5194 function invoke(fn, self, locals, serviceName) {
5195 if (typeof locals === 'string') {
5196 serviceName = locals;
5197 locals = null;
5198 }
5199
5200 var args = injectionArgs(fn, locals, serviceName);
5201 if (isArray(fn)) {
5202 fn = fn[fn.length - 1];
5203 }
5204
5205 if (!isClass(fn)) {
5206 // http://jsperf.com/angularjs-invoke-apply-vs-switch
5207 // #5388
5208 return fn.apply(self, args);
5209 } else {
5210 args.unshift(null);
5211 return new (Function.prototype.bind.apply(fn, args))();
5212 }
5213 }
5214
5215
5216 function instantiate(Type, locals, serviceName) {

Callers

nothing calls this directly

Calls 3

injectionArgsFunction · 0.70
isArrayFunction · 0.70
isClassFunction · 0.70

Tested by

no test coverage detected