Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix($injector): check if a fn is an array explicitly
Browse files Browse the repository at this point in the history
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
  • Loading branch information
IgorMinar committed Jun 24, 2014
1 parent 43ff573 commit b1a6baa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/auto/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,7 @@ function createInjector(modulesToLoad, strictDi) {
: getService(key)
);
}
if (!fn.$inject) {
// this means that we must be an array.
if (isArray(fn)) {
fn = fn[length];
}

Expand Down

0 comments on commit b1a6baa

Please sign in to comment.