]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(reactivity): avoid triggering effect when deleting property returns false (#168)
authorterencez <texvnars@gmail.com>
Wed, 9 Oct 2019 15:55:57 +0000 (23:55 +0800)
committerEvan You <yyx990803@gmail.com>
Wed, 9 Oct 2019 15:55:57 +0000 (11:55 -0400)
packages/reactivity/src/baseHandlers.ts

index fe07600d9f3a4a2fbb1128206953b0347c2a5da2..005cb3ddb83949b3d8b5e897fdf72d939b3a6f08 100644 (file)
@@ -70,7 +70,7 @@ function deleteProperty(target: any, key: string | symbol): boolean {
   const hadKey = hasOwn(target, key)
   const oldValue = target[key]
   const result = Reflect.deleteProperty(target, key)
-  if (hadKey) {
+  if (result && hadKey) {
     /* istanbul ignore else */
     if (__DEV__) {
       trigger(target, OperationTypes.DELETE, key, { oldValue })