eval 添加报错 warn
This commit is contained in:
parent
5e1d367e67
commit
da926a8b9c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue