MCPcopy Create free account
hub / github.com/apache/cloudstack / instantiate

Function instantiate

tools/ngui/static/js/lib/angular.js:2906–2917  ·  view source on GitHub ↗
(Type, locals)

Source from the content-addressed store, hash-verified

2904 }
2905
2906 function instantiate(Type, locals) {
2907 var Constructor = function() {},
2908 instance, returnedValue;
2909
2910 // Check if Type is annotated and use just the given function at n-1 as parameter
2911 // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
2912 Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype;
2913 instance = new Constructor();
2914 returnedValue = invoke(Type, instance, locals);
2915
2916 return isObject(returnedValue) ? returnedValue : instance;
2917 }
2918
2919 return {
2920 invoke: invoke,

Callers

nothing calls this directly

Calls 3

isArrayFunction · 0.85
invokeFunction · 0.85
isObjectFunction · 0.85

Tested by

no test coverage detected