From 0d3ace897e7221575eb1fb2cf5a669db70c2d216 Mon Sep 17 00:00:00 2001 From: wangxinyu Date: Thu, 4 Sep 2025 11:31:31 +0800 Subject: [PATCH] add absolute path check Issue: https://gitee.com/openharmony/developtools_ace_ets2bundle/issues/ICWB55 Signed-off-by: wangxinyu --- compiler/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/utils.ts b/compiler/src/utils.ts index 7b0a287a9..247f74696 100644 --- a/compiler/src/utils.ts +++ b/compiler/src/utils.ts @@ -1303,7 +1303,7 @@ export function removeDecorator(decorators: readonly ts.Decorator[], decoratorNa export function isFileInProject(filePath: string, projectRootPath: string): boolean { const relativeFilePath: string = toUnixPath(path.relative(toUnixPath(projectRootPath), toUnixPath(filePath))); // When processing ohmurl, hsp's filePath is consistent with moduleRequest - return fs.existsSync(filePath) && fs.statSync(filePath).isFile() && !relativeFilePath.startsWith('../'); + return path.isAbsolute(filePath) && fs.existsSync(filePath) && fs.statSync(filePath).isFile() && !relativeFilePath.startsWith('../'); } export function getProjectRootPath(filePath: string, projectConfig: Object, rootPathSet: Object): string { -- Gitee