diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-02-28 22:02:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-28 22:02:24 +0800 |
commit | 0daa199fa85e60b78b04b82a91acdb230cb42229 (patch) | |
tree | ba8edb563703f738d3c06a1e99e4a5070362baca /README.md | |
parent | 73e98dcda48be52f2c045038554b2cfe184a9a5a (diff) | |
download | tracifyjs-0daa199fa85e60b78b04b82a91acdb230cb42229.tar.gz tracifyjs-0daa199fa85e60b78b04b82a91acdb230cb42229.zip |
migrate safe transformations out of `unsafe_comps` (#2962)
fixes #2959
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -605,8 +605,8 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u side effects permitting. - `comparisons` (default: `true`) -- apply certain optimizations to binary nodes, - e.g. `!(a <= b) → a > b` (only when `unsafe_comps`), attempts to negate binary - nodes, e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc. + e.g. `!(a <= b) → a > b`, attempts to negate binary nodes, e.g. + `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc. - `conditionals` (default: `true`) -- apply optimizations for `if`-s and conditional expressions @@ -730,12 +730,8 @@ If you're using the `X-SourceMap` header instead, you can just omit `sourceMap.u - `unsafe` (default: `false`) -- apply "unsafe" transformations (discussion below) -- `unsafe_comps` (default: `false`) -- Reverse `<` and `<=` to `>` and `>=` to - allow improved compression. This might be unsafe when an at least one of two - operands is an object with computed values due the use of methods like `get`, - or `valueOf`. This could cause change in execution order after operands in the - comparison are switching. Compression only works if both `comparisons` and - `unsafe_comps` are both set to true. +- `unsafe_comps` (default: `false`) -- compress expressions like `a <= b` assuming + none of the operands can be (coerced to) `NaN`. - `unsafe_Function` (default: `false`) -- compress and mangle `Function(args, code)` when both `args` and `code` are string literals. |