1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 10:27:59 +01:00

Use JSON.parse rather than eval to parse strings.

--HG--
branch : mode-refactoring
This commit is contained in:
Kris Maglione
2010-10-06 23:28:42 -04:00
parent 41335adaae
commit 76e331afea
2 changed files with 2 additions and 4 deletions

View File

@@ -917,7 +917,7 @@ const Commands = Module("commands", {
if ((res = re2.exec(str)))
arg += keepQuotes ? res[0] : res[2].replace(/\\(.)/g, "$1");
else if ((res = /^(")((?:[^\\"]|\\.)*)("?)/.exec(str)))
arg += keepQuotes ? res[0] : window.eval(res[0] + (res[3] ? "" : '"'));
arg += keepQuotes ? res[0] : JSON.parse(res[0] + (res[3] ? "" : '"'));
else if ((res = /^(')((?:[^']|'')*)('?)/.exec(str)))
arg += keepQuotes ? res[0] : res[2].replace("''", "'", "g");
else