aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWiktor Kwapisiewicz <wiktor@metacode.biz>2016-11-30 14:54:15 +0100
committerRichard van Velzen <rvanvelzen1@gmail.com>2017-01-19 16:47:10 +0100
commit0913db8c84c670a2d34fd312295e54c679807558 (patch)
tree0f84dd8f23d5553435ebcea0e57d359bed897536
parent5c7705fcada66f35878427d620a194ad9d2f2918 (diff)
downloadtracifyjs-0913db8c84c670a2d34fd312295e54c679807558.tar.gz
tracifyjs-0913db8c84c670a2d34fd312295e54c679807558.zip
Add note about name mangling when using --mangle-props=unquoted (#1314)
-rw-r--r--README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index eb3305b6..1be63009 100644
--- a/README.md
+++ b/README.md
@@ -285,6 +285,17 @@ of mangled property names.
Using the name cache is not necessary if you compress all your files in a
single call to UglifyJS.
+#### Mangling unquoted names (`--mangle-props=unquoted` or `--mangle-props=2`)
+
+Using quoted property name (`o["foo"]`) reserves the property name (`foo`)
+so that it is not mangled throughout the entire script even when used in an
+unquoted style (`o.foo`). Example:
+
+```
+$ echo 'var o={"foo":1, bar:3}; o.foo += o.bar; console.log(o.foo);' | uglifyjs --mangle-props=2 -mc
+var o={"foo":1,a:3};o.foo+=o.a,console.log(o.foo);
+```
+
#### Debugging property name mangling
You can also pass `--mangle-props-debug` in order to mangle property names