diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-09-18 14:35:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-18 21:35:29 +0800 |
commit | 38a46c86d7163002ad079eb9dd690e18b5c9da8f (patch) | |
tree | 9a1a4c1cfdd93c6aa577f53c6a143715fbb4707f /lib | |
parent | 0f0759ec15d32673333b2397882a7f3e043d4cf9 (diff) | |
download | tracifyjs-38a46c86d7163002ad079eb9dd690e18b5c9da8f.tar.gz tracifyjs-38a46c86d7163002ad079eb9dd690e18b5c9da8f.zip |
enhance `side_effects` (#4124)
- add documentation for `merge_vars`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index 61d6079c..cfd3e2b2 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -3892,7 +3892,8 @@ merge(Compressor.prototype, { if (is_undeclared_ref(expr) && global_pure_fns[expr.name]) return true; if (expr instanceof AST_Dot && is_undeclared_ref(expr.expression)) { var static_fn = static_fns[expr.expression.name]; - return static_fn && static_fn[expr.property]; + return static_fn && (static_fn[expr.property] + || expr.expression.name == "Math" && expr.property == "random"); } } return this.pure || !compressor.pure_funcs(this); |