mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-19 16:43:34 -04:00
Bugfix: fix double lazyForEach
Signed-off-by: laibo102 <laibo2@huawei.com> Change-Id: If1bed824ac157231da0e6cf31d355d9aa6960c66
This commit is contained in:
@@ -935,9 +935,10 @@ function processForEachComponentNew(node: ts.ExpressionStatement, newStatements:
|
||||
newStatements.push(createComponentCreationStatement(node, newForEachStatements), popNode);
|
||||
} else {
|
||||
if (argumentsArray[2]) {
|
||||
newStatements.push(itemGenFunctionStatement, itemIdFuncStatement, lazyForEachStatement, popNode);
|
||||
newStatements.push(ts.factory.createBlock([itemGenFunctionStatement, itemIdFuncStatement, lazyForEachStatement,
|
||||
popNode], true));
|
||||
} else {
|
||||
newStatements.push(itemGenFunctionStatement, lazyForEachStatement, popNode);
|
||||
newStatements.push(ts.factory.createBlock([itemGenFunctionStatement, lazyForEachStatement, popNode], true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+56
-54
@@ -199,67 +199,69 @@ class Test extends ViewPU {
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
});
|
||||
const __lazyForEachItemGenFunction = _item => {
|
||||
const row = _item;
|
||||
{
|
||||
const isLazyCreate = (globalThis.__lazyForEachItemGenFunction !== undefined) && true && (Grid.willUseProxy() === true);
|
||||
const itemCreation = (elmtId, isInitialRender) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
GridItem.create(deepRenderFunction, isLazyCreate);
|
||||
if (!isInitialRender) {
|
||||
GridItem.pop();
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
};
|
||||
const observedShallowRender = () => {
|
||||
this.observeComponentCreation((elmtId, isInitialRender) => {
|
||||
{
|
||||
const __lazyForEachItemGenFunction = _item => {
|
||||
const row = _item;
|
||||
{
|
||||
const isLazyCreate = (globalThis.__lazyForEachItemGenFunction !== undefined) && true && (Grid.willUseProxy() === true);
|
||||
const itemCreation = (elmtId, isInitialRender) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
GridItem.create(deepRenderFunction, isLazyCreate);
|
||||
if (!isInitialRender) {
|
||||
GridItem.pop();
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
});
|
||||
GridItem.pop();
|
||||
};
|
||||
const observedDeepRender = () => {
|
||||
this.observeComponentCreation(itemCreation);
|
||||
this.observeComponentCreation((elmtId, isInitialRender) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
Text.create(row);
|
||||
if (!isInitialRender) {
|
||||
Text.pop();
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
});
|
||||
Text.pop();
|
||||
GridItem.pop();
|
||||
};
|
||||
const deepRenderFunction = (elmtId, isInitialRender) => {
|
||||
itemCreation(elmtId, isInitialRender);
|
||||
this.updateFuncByElmtId.set(elmtId, itemCreation);
|
||||
this.observeComponentCreation((elmtId, isInitialRender) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
Text.create(row);
|
||||
if (!isInitialRender) {
|
||||
Text.pop();
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
});
|
||||
Text.pop();
|
||||
GridItem.pop();
|
||||
};
|
||||
if (isLazyCreate) {
|
||||
observedShallowRender();
|
||||
};
|
||||
const observedShallowRender = () => {
|
||||
this.observeComponentCreation((elmtId, isInitialRender) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
GridItem.create(deepRenderFunction, isLazyCreate);
|
||||
if (!isInitialRender) {
|
||||
GridItem.pop();
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
});
|
||||
GridItem.pop();
|
||||
};
|
||||
const observedDeepRender = () => {
|
||||
this.observeComponentCreation(itemCreation);
|
||||
this.observeComponentCreation((elmtId, isInitialRender) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
Text.create(row);
|
||||
if (!isInitialRender) {
|
||||
Text.pop();
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
});
|
||||
Text.pop();
|
||||
GridItem.pop();
|
||||
};
|
||||
const deepRenderFunction = (elmtId, isInitialRender) => {
|
||||
itemCreation(elmtId, isInitialRender);
|
||||
this.updateFuncByElmtId.set(elmtId, itemCreation);
|
||||
this.observeComponentCreation((elmtId, isInitialRender) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
Text.create(row);
|
||||
if (!isInitialRender) {
|
||||
Text.pop();
|
||||
}
|
||||
ViewStackProcessor.StopGetAccessRecording();
|
||||
});
|
||||
Text.pop();
|
||||
GridItem.pop();
|
||||
};
|
||||
if (isLazyCreate) {
|
||||
observedShallowRender();
|
||||
}
|
||||
else {
|
||||
observedDeepRender();
|
||||
}
|
||||
}
|
||||
else {
|
||||
observedDeepRender();
|
||||
}
|
||||
}
|
||||
};
|
||||
const __lazyForEachItemIdFunc = row => row;
|
||||
LazyForEach.create("1", this, this.data, __lazyForEachItemGenFunction, __lazyForEachItemIdFunc);
|
||||
LazyForEach.pop();
|
||||
};
|
||||
const __lazyForEachItemIdFunc = row => row;
|
||||
LazyForEach.create("1", this, this.data, __lazyForEachItemGenFunction, __lazyForEachItemIdFunc);
|
||||
LazyForEach.pop();
|
||||
}
|
||||
Grid.pop();
|
||||
}
|
||||
rerender() {
|
||||
|
||||
Reference in New Issue
Block a user