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

Commit b1a6baa

Browse files
committed
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
1 parent 43ff573 commit b1a6baa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/auto/injector.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,7 @@ function createInjector(modulesToLoad, strictDi) {
792792
: getService(key)
793793
);
794794
}
795-
if (!fn.$inject) {
796-
// this means that we must be an array.
795+
if (isArray(fn)) {
797796
fn = fn[length];
798797
}
799798

0 commit comments

Comments
 (0)