style($injector): add a comment to explain the distinction with isArray

This commit is contained in:
Robin Böhm 2013-04-30 00:02:58 +02:00 committed by Pete Bacon Darwin
parent e351874a0a
commit d3cd3c0a9b

View file

@ -585,6 +585,8 @@ function createInjector(modulesToLoad) {
var Constructor = function() {},
instance, returnedValue;
// Check if Type is annotated and use just the given function at n-1 as parameter
// e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype;
instance = new Constructor();
returnedValue = invoke(Type, instance, locals);