From 1a8249194b04bfee335eba47dc8a0f36c97a3c5c Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 22 Jun 2022 18:58:32 +0800 Subject: [PATCH] houhaoyu@huawei.com support deccjsunit/index Signed-off-by: houhaoyu Change-Id: If20b8fb59438acdbbc1c4069a5e1d7af5136af28 --- compiler/src/ets_checker.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index f457710..66fb980 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -166,8 +166,12 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R } } else { const modulePath: string = path.resolve(__dirname, '../../../api', moduleName + '.d.ts'); + const suffix: string = /\.js$/.test(moduleName) ? '' : '.js'; + const jsModulePath: string = path.resolve(__dirname, '../node_modules', moduleName + suffix); if (ts.sys.fileExists(modulePath)) { resolvedModules.push(getResolveModule(modulePath, '.d.ts')); + } else if (ts.sys.fileExists(jsModulePath)) { + resolvedModules.push(getResolveModule(modulePath, '.js')); } else { resolvedModules.push(null); }