-
-
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: enhance call to throw logic and handle return statements (#140)
- Loading branch information
1 parent
2ae9f64
commit a1bfaf1
Showing
7 changed files
with
204 additions
and
24 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
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