Open chopin opened 1 year ago
It seems that Python |= operates either in boolean or in bitwise depending on the types of its operands, but Javascript doesn't. Does Transcyprt have an option to translate it correctly? Should I modified all Python source code using boolean operators?
I found that Python boolean operator '|=' was translated to '|=' in Javascript. They look the same, but they are not the same.
In Javascript, '|=' is a bitwise operator returning 1 or 0, not true or false. Javascript has another operator for boolean operations, '||=' returning true or false. Following is examples showing the difference:
output result:
Thanks.