From 864ffa0de77bcfd79efc200fe2df1915c2bb5261 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Thu, 3 Jun 2021 18:24:02 +0800 Subject: [PATCH] opt: fix proxy handler use target directly --- doric-js/bundle/doric-lib.js | 2 +- doric-js/bundle/doric-vm.js | 2 +- doric-js/lib/src/ui/view.js | 2 +- doric-js/src/ui/view.ts | 2 +- doric-web/dist/index.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doric-js/bundle/doric-lib.js b/doric-js/bundle/doric-lib.js index df4d5390..0196059a 100644 --- a/doric-js/bundle/doric-lib.js +++ b/doric-js/bundle/doric-lib.js @@ -503,7 +503,7 @@ class Group extends Superview { set: (target, index, value) => { const ret = Reflect.set(target, index, value); // Let getDirty return true - this.dirtyProps.children = this.children.map(e => e.viewId); + this.dirtyProps.children = target.map(e => e.viewId); return ret; } }); diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index 457cc0b7..3f812538 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -2024,7 +2024,7 @@ class Group extends Superview { set: (target, index, value) => { const ret = Reflect.set(target, index, value); // Let getDirty return true - this.dirtyProps.children = this.children.map(e => e.viewId); + this.dirtyProps.children = target.map(e => e.viewId); return ret; } }); diff --git a/doric-js/lib/src/ui/view.js b/doric-js/lib/src/ui/view.js index d00c81b7..a74fe49c 100644 --- a/doric-js/lib/src/ui/view.js +++ b/doric-js/lib/src/ui/view.js @@ -385,7 +385,7 @@ export class Group extends Superview { set: (target, index, value) => { const ret = Reflect.set(target, index, value); // Let getDirty return true - this.dirtyProps.children = this.children.map(e => e.viewId); + this.dirtyProps.children = target.map(e => e.viewId); return ret; } }); diff --git a/doric-js/src/ui/view.ts b/doric-js/src/ui/view.ts index 179e5284..18379675 100644 --- a/doric-js/src/ui/view.ts +++ b/doric-js/src/ui/view.ts @@ -451,7 +451,7 @@ export abstract class Group extends Superview { set: (target, index, value) => { const ret = Reflect.set(target, index, value) // Let getDirty return true - this.dirtyProps.children = this.children.map(e => e.viewId) + this.dirtyProps.children = (target as View[]).map(e => e.viewId) return ret } }) diff --git a/doric-web/dist/index.js b/doric-web/dist/index.js index e8a68002..dad80778 100644 --- a/doric-web/dist/index.js +++ b/doric-web/dist/index.js @@ -2078,7 +2078,7 @@ class Group extends Superview { set: (target, index, value) => { const ret = Reflect.set(target, index, value); // Let getDirty return true - this.dirtyProps.children = this.children.map(e => e.viewId); + this.dirtyProps.children = target.map(e => e.viewId); return ret; } });