jsParse: Replace eval()
The evil() function is considered eval, replace it like we already did in looking glass. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2842>
This commit is contained in:
parent
a66ffcfc74
commit
13e20e47bf
@ -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 [];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user