aboutsummaryrefslogtreecommitdiff
path: root/lib/propmangle.js
AgeCommit message (Expand)Author
2017-04-04exclude mangling of special property names (#1779)...- `null` - `true` - `false` - numeric literalsAlex Lam S.L
2017-04-03fix `mangleProperties` on identifiers (#1776)...- fix handling of "-Infinity" - add test case for "-0" reverts #1481Alex Lam S.L
2017-04-03fix mangleProperties of `undefined` & `Infinity` (#1772)...`NaN` already works by the happy accident of `Number.NaN` fixes #1770Alex Lam S.L
2017-03-31sort options in alphabetical order (#1743)...They started off as functional groups I guess, but given the sheer number of options this is becoming too difficult to read.Alex Lam S.L
2017-02-10in mangle_names there is a check that the variable name is legal and that it ...Anat Dagan
2016-11-29Add --mangle-props-debug and fix --mangle-props=unquoted collision...Patch by @AshleyScirra Based on: PR #1316 Renamed the CLI debug option to --mangle-props-debug Fixes: #1321 name collision in --mangle-props=unquoted Ashley (Scirra)
2016-08-14Fix --mangle-props and --mangle-props=unquoted...Fixes: #1247 Fix --mangle-props and --name-cache inconsistency. AST_Dot and AST_Sub properties are now mangled by --mangle-props without regard to being used in an assignment statement. Note: if --mangle-props is used then *all* javascript files used must be uglified with the same mangle options. Fix the ignore_quoted=true mangle option, also known as `--mangle-props=unquoted`. If a given property is quoted anywhere it will not be mangled in any quoted or non-quoted context. kzc
2016-06-19Respect quote style in object literals...The option added in fbbaa42ee55a7f753f7cab9b1a905ccf73cf26d5 wasn't being respected inside object literals, so quoted property names would still be stripped out with this option. This is mostly a corner-case, but useful when the output is passed to something like the Closure compiler, where quoted property names can be used to prevent mangling. Shrey Banga
2015-08-05Fix mangling of property names which overwrite unmangleable properties...Fixes #747. Richard van Velzen
2015-06-09Add --mangle-regex optionJoao Carlos
2015-05-13fix again reserved propsMihai Bazon
2015-05-07Make reserved names take priority over the name cacheMihai Bazon
2015-04-22If name_cache is specified, do rename cached properties...(even if --mangle-props is not there) Mihai Bazon
2015-04-10Use the `before` visitor in mangle props...(works around a bug in our tree walker which, while cloning nodes, breaks references between labeled statements and break/continue labels) Mihai Bazon
2015-03-16Fix prop mangling...Even if not “defined”, do mangle if name exists in the cache. Mihai Bazon
2015-03-14Add property name mangler...We only touch properties that are present in an object literal, or which are assigned to. Example: x = { foo: 1 }; x.bar = 2; x["baz"] = 3; x[cond ? "qwe" : "asd"] = 4; console.log(x.stuff); The names "foo", "bar", "baz", "qwe" and "asd" will be mangled, and the resulting mangled names will be used for the same properties throughout the code. The "stuff" will not be, since it's just referenced but never assigned to. This *will* break most of the code out there, but could work on carefully written code: do not use eval, do not define methods or properties by walking an array of names, etc. Also, a comprehensive list of exclusions needs to be passed, to avoid mangling properties that are standard in JavaScript, DOM, used in external libraries etc. Mihai Bazon