-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle return statements and enhance call to throw logic
- Loading branch information
1 parent
2ae9f64
commit 3b76363
Showing
5 changed files
with
196 additions
and
22 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// @ts-nocheck | ||
const someThrow = () => { | ||
if (something) { | ||
while (true) { | ||
throw new Error("oh no"); | ||
} | ||
} else { | ||
for (let i = 0; i < 10; i++) { | ||
throw new Error("oh no"); | ||
} | ||
} | ||
} | ||
class Test { | ||
badMethod() { | ||
throw new Error("oh no"); | ||
} | ||
} | ||
|
||
const callToSomeThrow = () => { | ||
const testMethod = new Test(); | ||
return { | ||
test: someThrow(), | ||
testing: () => someThrow(), | ||
array: [someThrow(), someThrow()], | ||
object: { test: someThrow() }, | ||
class: testMethod.badMethod(), | ||
} | ||
} | ||
|
||
function test() { | ||
return someThrow(); | ||
} |
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