(Type, locals, serviceName)
| 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 |
| 4627 | // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); |
| 4628 | var ctor = (isArray(Type) ? Type[Type.length - 1] : Type); |
| 4629 | var args = injectionArgs(Type, locals, serviceName); |
| 4630 | // Empty object at position 0 is ignored for invocation with `new`, but required. |
| 4631 | args.unshift(null); |
| 4632 | return new (Function.prototype.bind.apply(ctor, args))(); |
| 4633 | } |
| 4634 | |
| 4635 | return { |
| 4636 | invoke: invoke, |
nothing calls this directly
no test coverage detected