MCPcopy Index your code
hub / github.com/angular-ui/ui-router / instantiate

Function instantiate

test/angular/1.2/angular.js:3970–3981  ·  view source on GitHub ↗
(Type, locals)

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 4

isArrayFunction · 0.85
invokeFunction · 0.70
isObjectFunction · 0.70
isFunctionFunction · 0.70

Tested by

no test coverage detected