fix($injector): check if a fn is an array explicitly

This change makes the code easier to read and also fixes a compatibility issue
with opal.js which pollutes the global state by setting $inject property on
Array prototype

Closes #7904
Closes #2653
This commit is contained in:
Igor Minar
2014-06-23 17:19:41 -07:00
parent 5a306b7ba3
commit 67c11b9a39

View File

@@ -762,8 +762,7 @@ function createInjector(modulesToLoad) {
: getService(key)
);
}
if (!fn.$inject) {
// this means that we must be an array.
if (isArray(fn)) {
fn = fn[length];
}