-
-
Notifications
You must be signed in to change notification settings - Fork 41
Support return statements inside switch and try/catch/finally #13
Comments
To be clear: this is only for |
That's right. If you encounter the issue, you can just work around it by assigning to a variable, then returning that variable after the block. That's pretty much what Kneden would do automatically for you as soon as this is fixed anyway... |
@nolanlawson The newly opened #21 makes me less confident about my previous post. Consider Kneden an alpha-quality tool that will likely require workarounds, for now. So pretty much what the README file says. |
Is the development on this stale? Wondering how I could help out to make it non-alpha. |
@raphaelokon Yes, development pretty much stalled. I would be open for PRs and the like, but currently I don't have the time to work on it myself. That might still change, but no guarantees. |
@marten-de-vries Thanks. I will give it a go and see if I can get the desired behavior implemented. Are there already tests added that describe the two subtasks mentioned in this issue? |
As an attempt to reignite this project ... To handle |
Would my proposal and shim help here? https://npmjs.com/promise.prototype.finally |
@marten-de-vries are you still maintaining this? Airbnb would love to use it, but it either needs to handle all the edge cases, or throw early when attempting to transpile them, so that there's zero chance that incorrect code can make it to production. |
@timdp Don't forget that returns also change the control flow. Still, something like that might work, and if it works I'd be fine merging something like that. |
@ljharb Can you convince AirBnB to pay for someone to fix this (at least by adding build-time failure)? |
I will definitely work on it! Is there anyone who could work on it (in a reasonable amount of time) for whom a reasonable amount of money would enable them to do it? If so, please email me! |
@ljharb did this get anywhere in the past 3ish months? thinking about taking it up |
Anyone know if |
No, I haven't had time to work on it; anyone should please feel free to start.
|
so I feel completely unqualified to try this since i've never written a babel plugin and usually go with babel-preset-stage-x. but here goes. it looks to me like we should try to generate tests that model what we think should happen and does not yet happen. right now we have test cases that cover switchi'm just going to focus on so in i like the simplicity/readability of the |
@loganfsmyth At our company, we've been using |
that discussion (and it is a worthwhile test to include) should probably happen on fast-async then? the people still interested in kneden are probably people who have decided against using fast-async for one reason or other |
Does it make any sense to resume the development of this plugin? There is also one more problem with Fixing that would require quite a design change and I don't think that is worth it, as |
You can use https://github.com/MatAtBread/fast-async |
Currently working in:
(a.k.a. still some work to do)
The text was updated successfully, but these errors were encountered: