Selaa lähdekoodia

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

Kael 7 vuotta sitten
vanhempi
commit
a7658e03a1
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      src/core/util/options.js

+ 5 - 1
src/core/util/options.js

@@ -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)
     }
   }