Skip to content

Commit f229397

Browse files
committed
use util hasOwn
1 parent 30afa7a commit f229397

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/instance/inject.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { hasSymbol } from 'core/util/env'
44
import { warn } from '../util/index'
55
import { defineReactive } from '../observer/index'
6+
import { hasOwn } from '../../shared/util'
67

78
export function initProvide (vm: Component) {
89
const provide = vm.$options.provide
@@ -57,7 +58,7 @@ export function resolveInject (inject: any, vm: Component): ?Object {
5758
}
5859
source = source.$parent
5960
}
60-
process.env.NODE_ENV !== 'production' && Object.keys(result).indexOf(key) < 0 &&
61+
process.env.NODE_ENV !== 'production' && !hasOwn(result, key) &&
6162
warn(`Injection "${key}" not found`, vm)
6263
}
6364
return result

0 commit comments

Comments
 (0)