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

Function instantiate

test/angular/1.3/angular.js:4222–4230  ·  view source on GitHub ↗
(Type, locals, serviceName)

Source from the content-addressed store, hash-verified

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,

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