introduce "strict" to pure_getters (#1795)

This commit is contained in:
Alex Lam S.L
2017-04-07 13:31:58 +08:00
committed by GitHub
parent 281e882d27
commit 0f4cd73dcc
4 changed files with 59 additions and 16 deletions

View File

@@ -411,6 +411,8 @@ to set `true`; it's effectively a shortcut for `foo=true`).
- `pure_getters` -- the default is `false`. If you pass `true` for
this, UglifyJS will assume that object property access
(e.g. `foo.bar` or `foo["bar"]`) doesn't have any side effects.
Specify `"strict"` to treat `foo.bar` as side-effect-free only when
`foo` is certain to not throw, i.e. not `null` or `undefined`.
- `pure_funcs` -- default `null`. You can pass an array of names and
UglifyJS will assume that those functions do not produce side