minify icon indicating copy to clipboard operation
minify copied to clipboard

broken minified code: v + "" == "x";

Open jfgodoy opened this issue 6 years ago • 1 comments

Describe the bug There is a bug in the minification of the following code.

To Reproduce babel try it out

input

function compare(v) {
  return v + "" == "x";
}
compare(4) // false
compare('a') // false

Actual Output

function compare(a) {
  return a + "x";
}
compare(4) // '4x'
compare('a') // 'ax'

Expected Output don't minify this case

jfgodoy avatar Jul 25 '18 03:07 jfgodoy

yes!!!i have a same problem too!! how did u fix it ?

zhangshichun avatar Jul 11 '19 06:07 zhangshichun