-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a lint for Unconditional Recursion: checking the statements th…
…at appear before the recursive call Summary: This produces a lint error of unconditional recursion when there is a top level recursive call and there is no return or throw statement to break out of the recursion before the recursive call. The return or throw statement could be within multiple nested conditionals. The expression following the return/throw statement is checked to ensure that it is anything other than a recursive call. If there are mutliple base cases, then it is considered unconditional recursion if each of the return or throw statements in the base cases are recursive function calls. The function/method may or may not have arguments. The different types of function/method calls detected by linter are: 1) return statements 2) throw statements 3) static methods 4) instance methods 5) Await Reviewed By: Wilfred Differential Revision: D37754411 fbshipit-source-id: c2767d1df54350072b8663de5705d786b7aa5313
- Loading branch information
1 parent
49cc341
commit 5c8e506
Showing
3 changed files
with
287 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.