handle pure_funcs under inline & reduce_vars correctly (#3066)

fixes #3065
This commit is contained in:
Alex Lam S.L
2018-04-10 02:46:38 +08:00
committed by GitHub
parent 87857b0f1b
commit 183da16896
3 changed files with 116 additions and 6 deletions

View File

@@ -685,7 +685,8 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u
pass `pure_funcs: [ 'Math.floor' ]` to let it know that this
function won't produce any side effect, in which case the whole
statement would get discarded. The current implementation adds some
overhead (compression will be slower).
overhead (compression will be slower). Make sure symbols under `pure_funcs`
are also under `mangle.reserved` to avoid mangling.
- `pure_getters` (default: `"strict"`) -- If you pass `true` for
this, UglifyJS will assume that object property access