Skip to content

Commit 01db8fe

Browse files
committed
remove isArray branch in resolveInject
1 parent 574162e commit 01db8fe

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: src/core/instance/inject.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,14 @@ export function initInjections (vm: Component) {
3838
export function resolveInject (inject: any, vm: Component): ?Object {
3939
if (inject) {
4040
// inject is :any because flow is not smart enough to figure out cached
41-
// isArray here
42-
const isArray = Array.isArray(inject)
4341
const result = Object.create(null)
44-
const keys = isArray
45-
? inject
46-
: hasSymbol
42+
const keys = hasSymbol
4743
? Reflect.ownKeys(inject)
4844
: Object.keys(inject)
4945

5046
for (let i = 0; i < keys.length; i++) {
5147
const key = keys[i]
52-
const provideKey = isArray ? key : inject[key]
48+
const provideKey = inject[key]
5349
let source = vm
5450
while (source) {
5551
if (source._provided && provideKey in source._provided) {

0 commit comments

Comments
 (0)