Skip to content

Commit

Permalink
Rename section "Never use eval()!" to "Never use direct eval()!" (mdn…
Browse files Browse the repository at this point in the history
…#32497)

* Rename section "Never use eval()!" to "Never use direct eval()!"

- Despite the section title, the contents of the body are referring specifically to _direct_ `eval()`.

* Fix broken links after changing section name
  • Loading branch information
DanKaplanSES authored Mar 1, 2024
1 parent d77e0bb commit d20cf57
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.eval

{{jsSidebar("Objects")}}

> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use eval()!](#never_use_eval!), below.
> **Warning:** Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use `eval()`. See [Never use direct eval()!](#never_use_direct_eval!), below.
The **`eval()`** function evaluates JavaScript code represented as a string and returns its completion value. The source is parsed as a script.

Expand Down Expand Up @@ -162,7 +162,7 @@ Indirect eval can be seen as if the code is evaluated within a separate `<script
new Ctor(); // [Function: Ctor]
```
### Never use eval()!
### Never use direct eval()!
Using direct `eval()` suffers from multiple problems:
Expand Down

0 comments on commit d20cf57

Please sign in to comment.