diff --git a/js/misc/jsParse.js b/js/misc/jsParse.js index 97a6ce470..18ce70398 100644 --- a/js/misc/jsParse.js +++ b/js/misc/jsParse.js @@ -197,7 +197,9 @@ function getPropertyNamesFromExpression(expr, commandHeader = '') { let obj = {}; if (!isUnsafeExpression(expr)) { try { - obj = eval(commandHeader + expr); + const lines = expr.split(';'); + lines.push(`return ${lines.pop()}`); + obj = Function(commandHeader + lines.join(';'))(); } catch (e) { return []; }