eval 添加报错 warn

This commit is contained in:
liaoxuezhi 2019-07-24 11:10:03 +08:00
parent 5e1d367e67
commit da926a8b9c
1 changed files with 2 additions and 0 deletions

View File

@ -37,6 +37,7 @@ export function evalExpression(expression: string, data?: object): boolean {
data = data || {};
return fn.call(data, data);
} catch (e) {
console.warn(e);
return false;
}
}
@ -51,6 +52,7 @@ export function evalJS(js: string, data: object): any {
data = data || {};
return fn.call(data, data);
} catch (e) {
console.warn(e);
return null;
}
}