From b91cc5e433138bed03b809869c93c19cd7df96f6 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 30 Mar 2022 10:53:24 +0800 Subject: [PATCH] houhaoyu@huawei.com transform js api Signed-off-by: houhaoyu Change-Id: I0676ed6ff10fecd1d3026eff8453a88da68bcab6 --- compiler/src/process_system_module.ts | 2 +- compiler/src/validate_ui_syntax.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/src/process_system_module.ts b/compiler/src/process_system_module.ts index 89745d7..505bfdd 100644 --- a/compiler/src/process_system_module.ts +++ b/compiler/src/process_system_module.ts @@ -16,5 +16,5 @@ import { processSystemApi } from './validate_ui_syntax'; module.exports = function processSystemModule(source: string): string { - return processSystemApi(source, false, this.resourcePath); + return processSystemApi(source, false, this.resourcePath, true); }; diff --git a/compiler/src/validate_ui_syntax.ts b/compiler/src/validate_ui_syntax.ts index fc601aa..7d06061 100644 --- a/compiler/src/validate_ui_syntax.ts +++ b/compiler/src/validate_ui_syntax.ts @@ -735,7 +735,8 @@ export function preprocessExtend(content: string, extendCollection?: Set }); } -export function processSystemApi(content: string, isProcessWhiteList: boolean = false, sourcePath?: string): string { +export function processSystemApi(content: string, isProcessWhiteList: boolean = false, + sourcePath: string = null, isSystemModule: boolean = false): string { let REG_SYSTEM: RegExp; if (isProcessWhiteList) { REG_SYSTEM = @@ -761,7 +762,7 @@ export function processSystemApi(content: string, isProcessWhiteList: boolean = if (!VALIDATE_MODULE.includes(systemValue)){ importModuleCollection.add(systemValue); } - if (!isProcessWhiteList && validateWhiteListModule(moduleType, systemKey)) { + if (!isProcessWhiteList && validateWhiteListModule(moduleType, systemKey) && !isSystemModule) { return item; } else if (isProcessWhiteList) { systemValue = item2;