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

Arrow function lose the return keyword #6

Closed
yongjuntang opened this issue Jan 14, 2019 · 4 comments
Closed

Arrow function lose the return keyword #6

yongjuntang opened this issue Jan 14, 2019 · 4 comments

Comments

@yongjuntang
Copy link

yongjuntang commented Jan 14, 2019

Hello,
I have encountered some problems when using this code.
The arrow function does not add the return keyword after the conversion.

Here are the pre-conversion and post-conversion code.

JS:
Pre-conversion code :if(ships.some(s => s.ship.children('.boom').length == 0)){
console.log('111');
}

Post-conversion code:if (ships.some((s) => {
s.ship.children('.boom').length == 0;
//this line should "return s.ship.children('.boom').length == 0;"
})) {
console.log('111');
}

@mck89
Copy link
Owner

mck89 commented Jan 14, 2019

I can confirm the bug, it must omit brackets if there is only one statement and it's not a ReturnStatement or maybe just if it contains an expression. I will work on it, thank you!

@yongjuntang
Copy link
Author

Your work has saved me a lot of time, look forward to your new version, thanks.

@mck89 mck89 closed this as completed in f4ce80c Jan 16, 2019
@mck89
Copy link
Owner

mck89 commented Jan 16, 2019

I've just released the new version 1.9.1 that contains the fix for this issue

@yongjuntang
Copy link
Author

I've used the lastest version,everything is ok.

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

No branches or pull requests

2 participants