MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / invoke

Function invoke

OpenReservation/wwwroot/Scripts/angular.js:4604–4623  ·  view source on GitHub ↗
(fn, self, locals, serviceName)

Source from the content-addressed store, hash-verified

4602 }
4603
4604 function invoke(fn, self, locals, serviceName) {
4605 if (typeof locals === 'string') {
4606 serviceName = locals;
4607 locals = null;
4608 }
4609
4610 var args = injectionArgs(fn, locals, serviceName);
4611 if (isArray(fn)) {
4612 fn = fn[fn.length - 1];
4613 }
4614
4615 if (!isClass(fn)) {
4616 // http://jsperf.com/angularjs-invoke-apply-vs-switch
4617 // #5388
4618 return fn.apply(self, args);
4619 } else {
4620 args.unshift(null);
4621 return new (Function.prototype.bind.apply(fn, args))();
4622 }
4623 }
4624
4625 function instantiate(Type, locals, serviceName) {
4626 // Check if Type is annotated and use just the given function at n-1 as parameter

Callers

nothing calls this directly

Calls 2

injectionArgsFunction · 0.85
isClassFunction · 0.85

Tested by

no test coverage detected