Browse Source

refactor: tweak data merge strategy (#6833)

* tweak: The value of this is always undefined

* parentVal and childVal must have a presence, otherwise the strats.data policy function will not be executed
Huo Chunyang 8 years ago
parent
commit
ee0e8b5ce1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/core/util/options.js

+ 2 - 2
src/core/util/options.js

@@ -89,7 +89,7 @@ export function mergeDataOrFn (
         typeof parentVal === 'function' ? parentVal.call(this) : parentVal
       )
     }
-  } else if (parentVal || childVal) {
+  } else {
     return function mergedInstanceDataFn () {
       // instance merge
       const instanceData = typeof childVal === 'function'
@@ -123,7 +123,7 @@ strats.data = function (
 
       return parentVal
     }
-    return mergeDataOrFn.call(this, parentVal, childVal)
+    return mergeDataOrFn(parentVal, childVal)
   }
 
   return mergeDataOrFn(parentVal, childVal, vm)