fix(watch): avoid traversing objects that are marked non-reactive
e.g. Vue public instances
This commit is contained in:
parent
51d2be2038
commit
9acc9a1fa8
@ -5,7 +5,8 @@ import {
|
||||
Ref,
|
||||
ComputedRef,
|
||||
ReactiveEffectOptions,
|
||||
isReactive
|
||||
isReactive,
|
||||
ReactiveFlags
|
||||
} from '@vue/reactivity'
|
||||
import { SchedulerJob, queuePreFlushCb } from './scheduler'
|
||||
import {
|
||||
@ -390,7 +391,11 @@ export function createPathGetter(ctx: any, path: string) {
|
||||
}
|
||||
|
||||
function traverse(value: unknown, seen: Set<unknown> = new Set()) {
|
||||
if (!isObject(value) || seen.has(value)) {
|
||||
if (
|
||||
!isObject(value) ||
|
||||
seen.has(value) ||
|
||||
(value as any)[ReactiveFlags.SKIP]
|
||||
) {
|
||||
return value
|
||||
}
|
||||
seen.add(value)
|
||||
|
Loading…
Reference in New Issue
Block a user