aboutsummaryrefslogtreecommitdiff
path: root/lib/propmangle.js
AgeCommit message (Collapse)Author
2021-01-24support BigInt literals (#4583)Alex Lam S.L
2020-11-08support computed property name in object literal (#4268)Alex Lam S.L
2020-08-24tidy up various interfaces (#4066)Alex Lam S.L
2020-08-23enhance `mangle.properties` (#4064)Alex Lam S.L
2020-05-05update links to repository after rename (#3847)Alex Lam S.L
2018-07-26fix corner case in `ie8` & `rename` (#3223)Alex Lam S.L
2018-06-06general clean-ups (#3175)Alex Lam S.L
2018-04-06mangle `Object.defineProperty()` (#3059)Alex Lam S.L
fixes #869
2018-01-05fix `mangle` name collision across files (#2722)Alex Lam S.L
2017-12-01improve code reuse (#2542)Alex Lam S.L
2017-07-29improve `mangle.properties` (#2261)Alex Lam S.L
- include dead code when `keep_quoted` - unify `keep_quoted` & `reserved` - make `test/run-tests.js` consistent with `minify()` fixes #2256
2017-07-15reject malformed CLI parameters (#2239)Alex Lam S.L
fixes #2237
2017-06-09marshal `mangle[.properties].reserved` from non-Array values (#2072)Alex Lam S.L
2017-04-15unify CLI & API under `minify()` (#1811)Alex Lam S.L
- rename `screw_ie8` to `ie8` - rename `mangle.except` to `mangle.reserved` - rename `mangle.properties.ignore_quoted` to `mangle.properties.keep_quoted` - compact `sourceMap` options - more stringent verification on input `options` - toplevel shorthands - `ie8` - `keep_fnames` - `toplevel` - `warnings` - support arrays and unquoted string values on CLI - drop `fromString` from `minify()` - `minify()` no longer handles any `fs` operations - unify order of operations for `mangle_properties()` on CLI & API - `bin/uglifyjs` used to `mangle_properties()` before even `Compressor` - `minify()` used to `mangle_properties()` after `Compressor` but before `mangle_names()` - both will now do `Compressor`, `mangle_names()` then `mangle_properties()` - `options.parse` / `--parse` for parser options beyond `bare_returns` - add `mangle.properties.builtins` to disable built-in reserved list - disable with `--mangle-props builtins` on CLI - `warnings` now off by default - add `--warn` and `--verbose` on CLI - drop `--enclose` - drop `--export-all` - drop `--reserved-file` - use `--mangle reserved` instead - drop `--reserve-domprops` - enabled by default, disable with `--mangle-props domprops` - drop `--prefix` - use `--source-map base` instead - drop `--lint` - remove `bin/extract-props.js` - limit exposure of internal APIs - update documentations closes #96 closes #102 closes #136 closes #166 closes #243 closes #254 closes #261 closes #311 closes #700 closes #748 closes #912 closes #1072 closes #1366 fixes #101 fixes #123 fixes #124 fixes #263 fixes #379 fixes #419 fixes #423 fixes #461 fixes #465 fixes #576 fixes #737 fixes #772 fixes #958 fixes #1036 fixes #1142 fixes #1175 fixes #1220 fixes #1223 fixes #1280 fixes #1359 fixes #1368
2017-04-12convert `AST_Seq` from binary tree to array (#1460)Alex Lam S.L
- rename `AST_Seq` to `AST_Sequence` - raise default sequences_limit from 200 to 800
2017-04-04exclude mangling of special property names (#1779)Alex Lam S.L
- `null` - `true` - `false` - numeric literals
2017-04-03fix `mangleProperties` on identifiers (#1776)Alex Lam S.L
- fix handling of "-Infinity" - add test case for "-0" reverts #1481
2017-04-03fix mangleProperties of `undefined` & `Infinity` (#1772)Alex Lam S.L
`NaN` already works by the happy accident of `Number.NaN` fixes #1770
2017-03-31sort options in alphabetical order (#1743)Alex Lam S.L
They started off as functional groups I guess, but given the sheer number of options this is becoming too difficult to read.
2017-02-10in mangle_names there is a check that the variable name is legal and that it ↵Anat Dagan
is not a reserved word. This should apply to propsmangle as well.
2016-11-29Add --mangle-props-debug and fix --mangle-props=unquoted collisionAshley (Scirra)
Patch by @AshleyScirra Based on: PR #1316 Renamed the CLI debug option to --mangle-props-debug Fixes: #1321 name collision in --mangle-props=unquoted
2016-08-14Fix --mangle-props and --mangle-props=unquotedkzc
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.
2016-06-19Respect quote style in object literalsShrey Banga
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.
2015-08-05Fix mangling of property names which overwrite unmangleable propertiesRichard van Velzen
Fixes #747.
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 propertiesMihai Bazon
(even if --mangle-props is not there)
2015-04-10Use the `before` visitor in mangle propsMihai Bazon
(works around a bug in our tree walker which, while cloning nodes, breaks references between labeled statements and break/continue labels)
2015-03-16Fix prop manglingMihai Bazon
Even if not “defined”, do mangle if name exists in the cache.
2015-03-14Add property name manglerMihai Bazon
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.