(Type, locals, serviceName)
| 4610 | |
| 4611 | |
| 4612 | function instantiate(Type, locals, serviceName) { |
| 4613 | // Check if Type is annotated and use just the given function at n-1 as parameter |
| 4614 | // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); |
| 4615 | var ctor = (isArray(Type) ? Type[Type.length - 1] : Type); |
| 4616 | var args = injectionArgs(Type, locals, serviceName); |
| 4617 | // Empty object at position 0 is ignored for invocation with `new`, but required. |
| 4618 | args.unshift(null); |
| 4619 | return new (Function.prototype.bind.apply(ctor, args))(); |
| 4620 | } |
| 4621 | |
| 4622 | |
| 4623 | return { |
nothing calls this directly
no test coverage detected