This is causing at least two problems in atom. I think this negation behavior probably needs to be behind a --loose flag, since it doesn't work for operands like NaN and undefined.
The text was updated successfully, but these errors were encountered:
Fixesdecaffeinate#902
For both normal binary operators and chained comparison operators, we need to be
careful about rewriting `!(a < b)` as `a >= b`, since the rewrite isn't correct
for cases like `NaN`. Now, we just do the simpler negation by default and only
do the nicer-looking one with an opt-in flag.
Fixes#902
For both normal binary operators and chained comparison operators, we need to be
careful about rewriting `!(a < b)` as `a >= b`, since the rewrite isn't correct
for cases like `NaN`. Now, we just do the simpler negation by default and only
do the nicer-looking one with an opt-in flag.
decaffeinate is producing the wrong JavaScript based on my CoffeeScript input:
(repl)
I get this output:
Here's what I expect it to be instead:
This is causing at least two problems in atom. I think this negation behavior probably needs to be behind a
--loose
flag, since it doesn't work for operands likeNaN
andundefined
.The text was updated successfully, but these errors were encountered: