mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-22 12:36:01 -04:00
fix checkneedupdatefiles endless circurlar Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: I39ee8ab85c219fa498ce34146bfc53c9417cb9d8
This commit is contained in:
@@ -449,12 +449,19 @@ function updateErrorFileCache(diagnostic: ts.Diagnostic): void {
|
|||||||
function filterInput(rootFileNames: string[]): string[] {
|
function filterInput(rootFileNames: string[]): string[] {
|
||||||
return rootFileNames.filter((file: string) => {
|
return rootFileNames.filter((file: string) => {
|
||||||
const needUpdate: NeedUpdateFlag = { flag: false };
|
const needUpdate: NeedUpdateFlag = { flag: false };
|
||||||
checkNeedUpdateFiles(path.resolve(file), needUpdate);
|
const alreadyCheckedFiles: Set<string> = new Set();
|
||||||
|
checkNeedUpdateFiles(path.resolve(file), needUpdate, alreadyCheckedFiles);
|
||||||
return needUpdate.flag;
|
return needUpdate.flag;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkNeedUpdateFiles(file: string, needUpdate: NeedUpdateFlag): void {
|
function checkNeedUpdateFiles(file: string, needUpdate: NeedUpdateFlag, alreadyCheckedFiles: Set<string>): void {
|
||||||
|
if (alreadyCheckedFiles.has(file)) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
alreadyCheckedFiles.add(file);
|
||||||
|
}
|
||||||
|
|
||||||
if (needUpdate.flag) {
|
if (needUpdate.flag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -467,7 +474,7 @@ function checkNeedUpdateFiles(file: string, needUpdate: NeedUpdateFlag): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < value.children.length; ++i) {
|
for (let i = 0; i < value.children.length; ++i) {
|
||||||
checkNeedUpdateFiles(value.children[i], needUpdate);
|
checkNeedUpdateFiles(value.children[i], needUpdate, alreadyCheckedFiles);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cache[file] = { mtimeMs, children: [], error: false };
|
cache[file] = { mtimeMs, children: [], error: false };
|
||||||
|
|||||||
Reference in New Issue
Block a user