File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ The `eval` function will execute a string of JavaScript code in the local scope.
11
11
test(); // 3
12
12
foo; // 1
13
13
14
- But ` eval ` only executes in local scope when it is being called ** directly ** * and *
15
- the name of the called function is actually ` eval ` .
14
+ However, ` eval ` only executes in the local scope when it is being called
15
+ ** directly ** * and * when the name of the called function is actually ` eval ` .
16
16
17
17
var foo = 1;
18
18
function test() {
@@ -35,14 +35,13 @@ in the global scope since `eval` is not being called directly in that case.
35
35
36
36
### Security Issues
37
37
38
- ` eval ` also is a security problem as it executes ** any** code given to it,
38
+ ` eval ` also is a security problem. Because it executes ** any** code given to it,
39
39
it should ** never** be used with strings of unknown or untrusted origins.
40
40
41
41
### In Conclusion
42
42
43
- ` eval ` should never be used, any code that makes use of it is to be questioned in
43
+ ` eval ` should never be used. Any code that makes use of it is to be questioned in
44
44
its workings, performance and security. In case something requires ` eval ` in
45
- order to work, its design is to be questioned and should ** not** be used in the
46
- first place, a * better design* should be used, that does not require the use of
47
- ` eval ` .
45
+ order to work, it should ** not** be used in the first place.
46
+ A * better design* should be used, that does not require the use of ` eval ` .
48
47
You can’t perform that action at this time.
0 commit comments