Function body being mistakenly optimized away
u9g opened this issue · 2 comments
u9g commented
Rollup Version
rollup v4.17.2
Operating System (or Browser)
Browser
Node Version (if applicable)
No response
Link To Reproduction
Expected Behaviour
Properly transpile the body of the compare
function, and keep Gt
, Lt
, Eq
Actual Behaviour
most of the compare
function is mistakenly optimized away and only new Lt()
remains
liuly0322 commented
As the arguments compare(0, 0 + 7)
here are all known at compile time, we can optimize some code inside function away. If the arguments here are unknown, for example repl, the function body will not be optimized.
Also, as v4.17.0 has a bug for function parameter tracking, there may be some cases compare
is called with a unknown value but the compare
is not deoptimized properly, can you confirm if v4.17.2 fix your problem?