transform js api

Signed-off-by: houhaoyu <houhaoyu@huawei.com>
Change-Id: Idd0e094ae604bbacb6f72afd7ea75c2cf8220573
This commit is contained in:
houhaoyu
2022-03-30 10:07:14 +08:00
parent f15281d197
commit 939d482120
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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);
};
+3 -2
View File
@@ -735,7 +735,8 @@ export function preprocessExtend(content: string, extendCollection?: Set<string>
});
}
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) {
if (!isProcessWhiteList && !isSystemModule) {
return item;
} else if (isProcessWhiteList) {
systemValue = item2;