From d3b23cb888949e3af2ee69d799454086d52abdb2 Mon Sep 17 00:00:00 2001 From: laibo102 Date: Wed, 24 Aug 2022 11:12:07 +0800 Subject: [PATCH] Update: update the order of parameters for forEach and relevant UT Signed-off-by: laibo102 Change-Id: Iaa01ec5ca7b8f63e0c68d2a1a4a144a36cd2192c --- compiler/src/process_component_build.ts | 2 +- .../render_component/foreach/foreach.ts | 2 +- .../inner_struct_state_management/@objectLink/@objectLink.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_component_build.ts b/compiler/src/process_component_build.ts index 421f601..4e2a765 100644 --- a/compiler/src/process_component_build.ts +++ b/compiler/src/process_component_build.ts @@ -1035,10 +1035,10 @@ function addForEachIdFuncParameter(argumentsArray: ts.Expression[]): ts.Identifi ts.factory.createIdentifier(ELMTID), ts.factory.createIdentifier(argumentsArray[0] && argumentsArray[0].getText()) ); + addForEachIdFuncParameterArr.push(ts.factory.createIdentifier(FOREACHITEMGENFUNCTION)); if (argumentsArray[2]) { addForEachIdFuncParameterArr.push(ts.factory.createIdentifier(FOREACHITEMIDFUNC)); } - addForEachIdFuncParameterArr.push(ts.factory.createIdentifier(FOREACHITEMGENFUNCTION)); return addForEachIdFuncParameterArr; } diff --git a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts index 77c2288..b40e21e 100644 --- a/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts +++ b/compiler/test/utForPartialUpdate/inner_component_transform/render_component/foreach/foreach.ts @@ -81,7 +81,7 @@ exports.expectResult = Text.pop(); }; const forEachItemIdFunc = item => item.toString(); - this.forEachUpdateFunction(elmtId, this.arr, forEachItemIdFunc, forEachItemGenFunction); + this.forEachUpdateFunction(elmtId, this.arr, forEachItemGenFunction, forEachItemIdFunc); if (!isInitialRender) { ForEach.pop(); } diff --git a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts index d62ab55..f687eb8 100644 --- a/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts +++ b/compiler/test/utForPartialUpdate/ui_state_management/inner_struct_state_management/@objectLink/@objectLink.ts @@ -167,7 +167,7 @@ class Parent extends ViewPU { } }; const forEachItemIdFunc = item => item.text; - this.forEachUpdateFunction(elmtId, this.models, forEachItemIdFunc, forEachItemGenFunction); + this.forEachUpdateFunction(elmtId, this.models, forEachItemGenFunction, forEachItemIdFunc); if (!isInitialRender) { ForEach.pop(); }