MCPcopy Create free account
hub / github.com/JacksonTian/fks / invoke

Function invoke

fks_chart/bower_components/angular/angular.js:3941–3966  ·  view source on GitHub ↗
(fn, self, locals)

Source from the content-addressed store, hash-verified

3939 }
3940
3941 function invoke(fn, self, locals){
3942 var args = [],
3943 $inject = annotate(fn),
3944 length, i,
3945 key;
3946
3947 for(i = 0, length = $inject.length; i < length; i++) {
3948 key = $inject[i];
3949 if (typeof key !== 'string') {
3950 throw $injectorMinErr('itkn',
3951 'Incorrect injection token! Expected service name as string, got {0}', key);
3952 }
3953 args.push(
3954 locals && locals.hasOwnProperty(key)
3955 ? locals[key]
3956 : getService(key)
3957 );
3958 }
3959 if (isArray(fn)) {
3960 fn = fn[length];
3961 }
3962
3963 // http://jsperf.com/angularjs-invoke-apply-vs-switch
3964 // #5388
3965 return fn.apply(self, args);
3966 }
3967
3968 function instantiate(Type, locals) {
3969 var Constructor = function() {},

Callers 1

instantiateFunction · 0.85

Calls 2

annotateFunction · 0.85
getServiceFunction · 0.85

Tested by

no test coverage detected