We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30afa7a commit f229397Copy full SHA for f229397
src/core/instance/inject.js
@@ -3,6 +3,7 @@
3
import { hasSymbol } from 'core/util/env'
4
import { warn } from '../util/index'
5
import { defineReactive } from '../observer/index'
6
+import { hasOwn } from '../../shared/util'
7
8
export function initProvide (vm: Component) {
9
const provide = vm.$options.provide
@@ -57,7 +58,7 @@ export function resolveInject (inject: any, vm: Component): ?Object {
57
58
}
59
source = source.$parent
60
- process.env.NODE_ENV !== 'production' && Object.keys(result).indexOf(key) < 0 &&
61
+ process.env.NODE_ENV !== 'production' && !hasOwn(result, key) &&
62
warn(`Injection "${key}" not found`, vm)
63
64
return result
0 commit comments