From 45d6b37ef4bc49b407d23f242fa6f00ee31f35f9 Mon Sep 17 00:00:00 2001 From: lihong Date: Tue, 18 Jan 2022 22:14:34 +0800 Subject: [PATCH] fixed 2b2b96d from https://gitee.com/lihong67/developtools_ace-ets2bundle/pulls/183 lihong67@huawei.com fix application.missonManager api transform. Signed-off-by: lihong Change-Id: Ia0edc01a38732136dfb7291759155680ef8622ec --- compiler/src/validate_ui_syntax.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index 7d1f30529..c57d75f02 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -802,13 +802,8 @@ function collectExtend(component: string, attribute: string, parameter: string): export function processSystemApi(content: string, isProcessWhiteList: boolean = false): string { let REG_SYSTEM: RegExp; - if (isProcessWhiteList) { - REG_SYSTEM = - /(import|const)\s+(.+)\s*=\s*(\_\_importDefault\()?require\(\s*['"]@(system|ohos)\.(\S+)['"]\s*\)(\))?/g; - } else { - REG_SYSTEM = - /import\s+(.+)\s+from\s+['"]@(system|ohos)\.(\S+)['"]|import\s+(.+)\s*=\s*require\(\s*['"]@(system|ohos)\.(\S+)['"]\s*\)/g; - } + REG_SYSTEM = + /import\s+(.+)\s+from\s+['"]@(system|ohos)\.(\S+)['"]|import\s+(.+)\s*=\s*require\(\s*['"]@(system|ohos)\.(\S+)['"]\s*\)/g; const REG_LIB_SO: RegExp = /import\s+(.+)\s+from\s+['"]lib(\S+)\.so['"]|import\s+(.+)\s*=\s*require\(\s*['"]lib(\S+)\.so['"]\s*\)/g; return content.replace(REG_LIB_SO, (_, item1, item2, item3, item4) => { @@ -819,13 +814,6 @@ export function processSystemApi(content: string, isProcessWhiteList: boolean = let moduleType: string = item2 || item5; let systemKey: string = item3 || item6; let systemValue: string = item1 || item4; - if (!isProcessWhiteList && validateWhiteListModule(moduleType, systemKey)) { - return item; - } else if (isProcessWhiteList) { - systemValue = item2; - moduleType = item4; - systemKey = item5; - } moduleCollection.add(`${moduleType}.${systemKey}`); if (NATIVE_MODULE.has(`${moduleType}.${systemKey}`)) { item = `var ${systemValue} = globalThis.requireNativeModule('${moduleType}.${systemKey}')`; -- Gitee