Skip to content

refactor: Reduce the number of explicit return statements. - #651

Merged
arthurschreiber merged 1 commit into
masterfrom
arthur/return-cleanup
Jan 6, 2018
Merged

arthurschreiber merged 1 commit into
masterfrom
arthur/return-cleanup

Conversation

@arthurschreiber

Copy link
Copy Markdown
Collaborator

While working on adding flow type information to the tedious source code, some CoffeeScript leftovers started to get in the way. 😞

One of the leftovers from the conversion are stray return statements. In CoffeeScript, the last statement in a function was implicitly and automatically used as the return value of the function. This is really annoying when adding types to functions, as that means functions can have different result types depending on the execution path taken through the function. Even more annoying when we consider the fact that many of these functions were not supposed to have a return value in the first place (and the return statement generated by CoffeeScript returned useless information).

This gets rid of many of these return statements, cleaning up the code and paving the way for adding type information later. 👍

@chdh

chdh commented Nov 18, 2017

Copy link
Copy Markdown
Collaborator

resolves #576

@arthurschreiber
arthurschreiber force-pushed the arthur/return-cleanup branch 2 times, most recently from e9e263f to e214da1 Compare December 11, 2017 06:29
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.

3 participants