Merge pull request #2228 from vsemozhetbyt/patch-13
Fix possible typo in 1.6.7 ("new Function" syntax)
This commit is contained in:
commit
44252ada82
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ What if it could access the outer variables?
|
|||
|
||||
The problem is that before JavaScript is published to production, it's compressed using a *minifier* -- a special program that shrinks code by removing extra comments, spaces and -- what's important, renames local variables into shorter ones.
|
||||
|
||||
For instance, if a function has `let userName`, minifier replaces it `let a` (or another letter if this one is occupied), and does it everywhere. That's usually a safe thing to do, because the variable is local, nothing outside the function can access it. And inside the function, minifier replaces every mention of it. Minifiers are smart, they analyze the code structure, so they don't break anything. They're not just a dumb find-and-replace.
|
||||
For instance, if a function has `let userName`, minifier replaces it with `let a` (or another letter if this one is occupied), and does it everywhere. That's usually a safe thing to do, because the variable is local, nothing outside the function can access it. And inside the function, minifier replaces every mention of it. Minifiers are smart, they analyze the code structure, so they don't break anything. They're not just a dumb find-and-replace.
|
||||
|
||||
So if `new Function` had access to outer variables, it would be unable to find renamed `userName`.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue