From 52bf8d2ad0e59af51dabda92c7a5cfd4d89aac36 Mon Sep 17 00:00:00 2001 From: yaochaonan Date: Thu, 30 Nov 2023 19:09:23 +0800 Subject: [PATCH] Adapt import har worker Issue:https://e.gitee.com/open_harmony/dashboard?issue=I8KU1Y Signed-off-by: yaochaonan Change-Id: Ic410cc6ba20ccd67c57b9bc80a87794a7db404df --- ecmascript/module/module_path_helper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ecmascript/module/module_path_helper.cpp b/ecmascript/module/module_path_helper.cpp index 87e1c36c7e..64282c5e68 100644 --- a/ecmascript/module/module_path_helper.cpp +++ b/ecmascript/module/module_path_helper.cpp @@ -53,7 +53,7 @@ CString ModulePathHelper::ConcatFileNameWithMerge(JSThread *thread, const JSPand } /* - * Before: inputFileName: 1. /data/storage/el1/bundle/moduleName/ets/xxx/xxx.abc + * Before: inputFileName: 1. /data/storage/el1/bundle/moduleName@namespace/ets/xxx/xxx.abc 2. @bundle:bundleName/moduleName/ets/xxx/xxx.abc 3. moduleName/ets/xxx/xxx.abc 4. .test/xxx/xxx.abc @@ -72,12 +72,13 @@ void ModulePathHelper::ParseOhmUrl(EcmaVM *vm, const CString &inputFileName, pos = startStrLen; } if (pos != CString::npos) { - // inputFileName: /data/storage/el1/bundle/moduleName/ets/xxx/xxx.abc + // inputFileName: /data/storage/el1/bundle/moduleName@namespace/ets/xxx/xxx.abc pos = inputFileName.find(PathHelper::SLASH_TAG, startStrLen); if (pos == CString::npos) { LOG_FULL(FATAL) << "Invalid Ohm url, please check."; } CString moduleName = inputFileName.substr(startStrLen, pos - startStrLen); + PathHelper::DeleteNamespace(moduleName); outBaseFileName = BUNDLE_INSTALL_PATH + moduleName + MERGE_ABC_ETS_MODULES; outEntryPoint = vm->GetBundleName() + PathHelper::SLASH_TAG + inputFileName.substr(startStrLen); } else {