mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-22 20:45:27 -04:00
fix application.missonManager api transform. Signed-off-by: lihong <lihong67@huawei.com> Change-Id: Ia0edc01a38732136dfb7291759155680ef8622ec
This commit is contained in:
@@ -802,13 +802,8 @@ function collectExtend(component: string, attribute: string, parameter: string):
|
|||||||
|
|
||||||
export function processSystemApi(content: string, isProcessWhiteList: boolean = false): string {
|
export function processSystemApi(content: string, isProcessWhiteList: boolean = false): string {
|
||||||
let REG_SYSTEM: RegExp;
|
let REG_SYSTEM: RegExp;
|
||||||
if (isProcessWhiteList) {
|
REG_SYSTEM =
|
||||||
REG_SYSTEM =
|
/import\s+(.+)\s+from\s+['"]@(system|ohos)\.(\S+)['"]|import\s+(.+)\s*=\s*require\(\s*['"]@(system|ohos)\.(\S+)['"]\s*\)/g;
|
||||||
/(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;
|
|
||||||
}
|
|
||||||
const REG_LIB_SO: RegExp =
|
const REG_LIB_SO: RegExp =
|
||||||
/import\s+(.+)\s+from\s+['"]lib(\S+)\.so['"]|import\s+(.+)\s*=\s*require\(\s*['"]lib(\S+)\.so['"]\s*\)/g;
|
/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) => {
|
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 moduleType: string = item2 || item5;
|
||||||
let systemKey: string = item3 || item6;
|
let systemKey: string = item3 || item6;
|
||||||
let systemValue: string = item1 || item4;
|
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}`);
|
moduleCollection.add(`${moduleType}.${systemKey}`);
|
||||||
if (NATIVE_MODULE.has(`${moduleType}.${systemKey}`)) {
|
if (NATIVE_MODULE.has(`${moduleType}.${systemKey}`)) {
|
||||||
item = `var ${systemValue} = globalThis.requireNativeModule('${moduleType}.${systemKey}')`;
|
item = `var ${systemValue} = globalThis.requireNativeModule('${moduleType}.${systemKey}')`;
|
||||||
|
|||||||
Reference in New Issue
Block a user