We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a00c63b commit c319cc7Copy full SHA for c319cc7
src/core/instance/inject.ts
@@ -1,4 +1,4 @@
1
-import { warn, hasSymbol, isFunction } from '../util/index'
+import { warn, hasSymbol, isFunction, isObject } from '../util/index'
2
import { defineReactive, toggleObserving } from '../observer/index'
3
import type { Component } from 'types/component'
4
import { provide } from 'v3/apiInject'
@@ -10,6 +10,9 @@ export function initProvide(vm: Component) {
10
const provided = isFunction(provideOption)
11
? provideOption.call(vm)
12
: provideOption
13
+ if (!isObject(provided)) {
14
+ return
15
+ }
16
const keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided)
17
setCurrentInstance(vm)
18
for (let i = 0; i < keys.length; i++) {
0 commit comments