-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect transformation of mixed boolean expression in unless statement #1384
Comments
Looks like the bug is in MainStage since the output of NormalizeStage looks okay. |
I get that we're applying DeMorgan's law to the unless statements
But I haven't looked at the code at all, so I have no idea what decaffeinate's actually doing |
This is the part that triggers it: decaffeinate/src/stages/main/patchers/ConditionalPatcher.ts Lines 98 to 100 in 4da99dd
Which calls e.g. this: decaffeinate/src/stages/main/patchers/LogicalOpPatcher.ts Lines 42 to 46 in 4da99dd
|
A note for future me or whoever might try to fix this: the bug is that the |
The |
decaffeinate is producing the wrong JavaScript based on my CoffeeScript input:
Link to REPL
I get this output:
Here's what I expect it to be instead: (Coffee's compiler)
Or something more similar to decaffeinate's:
The text was updated successfully, but these errors were encountered: