mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-25 14:16:03 -04:00
remove whitelist Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: Ida4f786e784362d0724314d5ce42a5781ad6247f
This commit is contained in:
@@ -289,18 +289,12 @@ export class ResultStates {
|
|||||||
const stateInfoReg: RegExp = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/;
|
const stateInfoReg: RegExp = /Property\s*'(\$?[_a-zA-Z0-9]+)' does not exist on type/;
|
||||||
const importInfoReg: RegExp = /Cannot find namespace\s*'([_a-zA-Z0-9]+)'\./;
|
const importInfoReg: RegExp = /Cannot find namespace\s*'([_a-zA-Z0-9]+)'\./;
|
||||||
if (this.matchMessage(message, props, propInfoReg) ||
|
if (this.matchMessage(message, props, propInfoReg) ||
|
||||||
this.matchMessage(message, props, stateInfoReg) ||
|
this.matchMessage(message, props, stateInfoReg)) {
|
||||||
this.matchMessage(message, [...importModuleCollection], importInfoReg)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
private matchMessage(message: string, nameArr: any, reg: RegExp): boolean {
|
private matchMessage(message: string, nameArr: any, reg: RegExp): boolean {
|
||||||
importModuleCollection.forEach(item => {
|
|
||||||
if (message.includes(item)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (reg.test(message)) {
|
if (reg.test(message)) {
|
||||||
const match: string[] = message.match(reg);
|
const match: string[] = message.match(reg);
|
||||||
if (match[1] && nameArr.includes(match[1])) {
|
if (match[1] && nameArr.includes(match[1])) {
|
||||||
|
|||||||
@@ -752,7 +752,7 @@ export function processSystemApi(content: string, isProcessWhiteList: boolean =
|
|||||||
if (!VALIDATE_MODULE.includes(systemValue)){
|
if (!VALIDATE_MODULE.includes(systemValue)){
|
||||||
importModuleCollection.add(systemValue);
|
importModuleCollection.add(systemValue);
|
||||||
}
|
}
|
||||||
if (!isProcessWhiteList && validateWhiteListModule(moduleType, systemKey)) {
|
if (!isProcessWhiteList) {
|
||||||
return item;
|
return item;
|
||||||
} else if (isProcessWhiteList) {
|
} else if (isProcessWhiteList) {
|
||||||
systemValue = item2;
|
systemValue = item2;
|
||||||
|
|||||||
Reference in New Issue
Block a user