Skip to content
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

Bool const in lambda rebased #2662

Closed

Conversation

cristianoc
Copy link
Collaborator

Rebasing #2437: a complete set of changes to represent booleans as true and false in js.

Cristiano Calcagno added 8 commits March 20, 2018 10:06
Minimal extension on the bucklescript side to still compile to numbers, just to check that all tests pass.
Next, compile to booleans.
Emit booleans instead of integers, and reveal that the type of Js.boolean is the same as bool.
So this should be a non-breaking change but allow to omit the conversion between Js.boolean and bool.
The translation of || and && used to return 0/1 instead of false/true.
Added tests that would have failed before the change.
In the generated .js files there are no more occurrences of
```
/* false */0
```
or
```
/* true */1
```
This does not change the generated files.
@bobzhang
Copy link
Member

bobzhang commented Apr 4, 2018

landed

@bobzhang bobzhang closed this Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants