(Type, locals, serviceName)
| 4451 | } |
| 4452 | |
| 4453 | function instantiate(Type, locals, serviceName) { |
| 4454 | // Check if Type is annotated and use just the given function at n-1 as parameter |
| 4455 | // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); |
| 4456 | // Object creation: http://jsperf.com/create-constructor/2 |
| 4457 | var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null); |
| 4458 | var returnedValue = invoke(Type, instance, locals, serviceName); |
| 4459 | |
| 4460 | return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; |
| 4461 | } |
| 4462 | |
| 4463 | return { |
| 4464 | invoke: invoke, |
nothing calls this directly
no test coverage detected