fix(data): skip recursive call if values are identical (#8967)

This commit is contained in:
Kael 2018-12-01 10:04:05 +11:00 committed by Evan You
parent 05001e695e
commit a7658e03a1

View File

@ -55,7 +55,11 @@ function mergeData (to: Object, from: ?Object): Object {
fromVal = from[key]
if (!hasOwn(to, key)) {
set(to, key, fromVal)
} else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
} else if (
toVal !== fromVal &&
isPlainObject(toVal) &&
isPlainObject(fromVal)
) {
mergeData(toVal, fromVal)
}
}