(Type, locals)
| 3968 | } |
| 3969 | |
| 3970 | function instantiate(Type, locals) { |
| 3971 | var Constructor = function() {}, |
| 3972 | instance, returnedValue; |
| 3973 | |
| 3974 | // Check if Type is annotated and use just the given function at n-1 as parameter |
| 3975 | // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]); |
| 3976 | Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype; |
| 3977 | instance = new Constructor(); |
| 3978 | returnedValue = invoke(Type, instance, locals); |
| 3979 | |
| 3980 | return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance; |
| 3981 | } |
| 3982 | |
| 3983 | return { |
| 3984 | invoke: invoke, |
nothing calls this directly
no test coverage detected