fix(watch): avoid traversing non-plain objects
This commit is contained in:
parent
f6dee53270
commit
62b8f4a39c
@ -18,7 +18,8 @@ import {
|
||||
NOOP,
|
||||
remove,
|
||||
isMap,
|
||||
isSet
|
||||
isSet,
|
||||
isPlainObject
|
||||
} from '@vue/shared'
|
||||
import {
|
||||
currentInstance,
|
||||
@ -391,9 +392,9 @@ function traverse(value: unknown, seen: Set<unknown> = new Set()) {
|
||||
value.forEach((v: any) => {
|
||||
traverse(v, seen)
|
||||
})
|
||||
} else {
|
||||
} else if (isPlainObject(value)) {
|
||||
for (const key in value) {
|
||||
traverse(value[key], seen)
|
||||
traverse((value as any)[key], seen)
|
||||
}
|
||||
}
|
||||
return value
|
||||
|
Loading…
Reference in New Issue
Block a user