mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 19:40:56 +08:00
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:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user