(Type, locals, serviceName)
| 4220 | } |
| 4221 | |
| 4222 | function instantiate(Type, locals, serviceName) { |
| 4223 | // Check if Type is annotated and use just the given function at n-1 as parameter |
| 4224 | // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); |
| 4225 | // Object creation: http://jsperf.com/create-constructor/2 |
| 4226 | var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null); |
| 4227 | var returnedValue = invoke(Type, instance, locals, serviceName); |
| 4228 | |
| 4229 | return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; |
| 4230 | } |
| 4231 | |
| 4232 | return { |
| 4233 | invoke: invoke, |
nothing calls this directly
no test coverage detected