Closed levi-nz closed 1 month ago
Btw the variable's init
field returns a number
, not undefined
, so this is definitely invalid. Even if both CallExpression
s returned undefined
, the result would be NaN
.
dead_branch_remover
is (wrongly) considering it as an unreachable branch for some reason, so the initializer does not matter.
Okay, I think return init.bind(this)();
is the reasoning of dead_branch_remover
.
It seems like it's correct
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
The variable
instantiatedVar14
in this script has aninit
value, but after runningsimplifier
on this script, theinit
part is removed, leaving the variable's value asundefined
. The culprit appears to bedead_branch_remover
from my testing.I will try make a minimal re-production when I have free time.
I have uploaded the script to Ghostbin for now, found at https://pst.innomi.net/paste/uv7882egh49frqfg64a72z8p , since it exceeded the character limit here.
Input code
No response
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs
SWC Info output
No response
Expected behavior
Variable should be left as-is, e.g.
var instantiatedVar14 = MDT() - C2T();
Actual behavior
Variable's
init
part is removed, becomingvar instantiatedVar14
(it is merged with other variables that have noinit
part)Version
1.7.10
Additional context
You can paste the input code above on play.swc.rs, the script is too large to create a link here.