Skip to content

Commit 87f86ea

Browse files
committed
fixes #1369
1 parent 43522e1 commit 87f86ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-js/99-js-misc/02-eval/article.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ Right now, there's almost no reason to use `eval`. If someone is using it, there
7777

7878
Please note that its ability to access outer variables has side-effects.
7979

80-
Code minifiers (tools used before JS gets to production, to compress it) replace local variables with shorter ones for optimization. That's usually safe, but not if `eval` is used, as it may reference them. So minifiers don't replace all local variables that might be visible from `eval`. That negatively affects code compression ratio.
80+
Code minifiers (tools used before JS gets to production, to compress it) rename local variables into shorter ones (like `a`, `b` etc) to make the code smaller. That's usually safe, but not if `eval` is used, as local variables may be accessed from eval'ed code string. So minifiers don't do that renaming for all variables potentially visible from `eval`. That negatively affects code compression ratio.
8181

82-
Using outer local variables inside `eval` is a bad programming practice, as it makes maintaining the code more difficult.
82+
Using outer local variables inside `eval` is also considered a bad programming practice, as it makes maintaining the code more difficult.
8383

8484
There are two ways how to be totally safe from such problems.
8585

0 commit comments

Comments
 (0)