Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion misc_docs/syntax/decorator_does_not_raise.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ keywords: ["doesNotRaise", "decorator"]
name: "@doesNotRaise"
summary: "This is the `@doesNotRaise` decorator."
category: "decorators"
status: "deprecated"
---

> Deprecated since v12.0.0. Use the [@doesNotThrow](https://rescript-lang.org/syntax-lookup#does-not-throw-decorator) decorator instead.

> This decorator requires [`reanalyze`](https://github.com/rescript-lang/reanalyze), a code analysis tool for ReScript, to be installed. [Click here to read about how you get started with reanalyze.](https://github.com/rescript-lang/reanalyze).

`@doesNotRaise` is used to override the reanalyze's exception analysis and state that an expression does not raise any exceptions, even though the analysis reports otherwise. This can happen for example in the case of array access where the analysis does not perform range checks but takes a conservative stance that any access could potentially raise.
`@doesNotRaise` is used to override the reanalyze's exception analysis and state that an expression does not throw any exceptions, even though the analysis reports otherwise. This can happen for example in the case of array access where the analysis does not perform range checks but takes a conservative stance that any access could potentially throw.

### References

Expand Down
15 changes: 15 additions & 0 deletions misc_docs/syntax/decorator_does_not_throw.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
id: "does-not-throw-decorator"
keywords: ["doesNotThrow", "decorator"]
name: "@doesNotThrow"
summary: "This is the `@doesNotThrow` decorator."
category: "decorators"
---

> This decorator requires [`reanalyze`](https://github.com/rescript-lang/reanalyze), a code analysis tool for ReScript, to be installed. [Click here to read about how you get started with reanalyze.](https://github.com/rescript-lang/reanalyze).

`@doesNotThrow` is used to override the reanalyze's exception analysis and state that an expression does not throw any exceptions, even though the analysis reports otherwise. This can happen for example in the case of array access where the analysis does not perform range checks but takes a conservative stance that any access could potentially throw.

### References

- [Reanalyze: Exception Analysis](https://github.com/rescript-lang/reanalyze/blob/master/EXCEPTION.md)
5 changes: 4 additions & 1 deletion misc_docs/syntax/decorator_raises.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ keywords: ["raises", "decorator"]
name: "@raises"
summary: "This is the `@raises` decorator."
category: "decorators"
status: "deprecated"
---

> Deprecated since v12.0.0. Use the [@throws](https://rescript-lang.org/syntax-lookup#throws-decorator) decorator instead.

> This decorator requires [`reanalyze`](https://github.com/rescript-lang/reanalyze), a code analysis tool for ReScript, to be installed. [Click here to read about how you get started with reanalyze.](https://github.com/rescript-lang/reanalyze).

`@raises` is picked up by reanalyze's exception analysis, and acknowledges that a function can raise exceptions that are not caught, and suppresses a warning in that case. Callers of the functions are then subjected to the same rule. Example `@raises(Exn)` or `@raises([E1, E2, E3])` for multiple exceptions.
`@raises` is picked up by reanalyze's exception analysis, and acknowledges that a function can throw exceptions that are not caught, and suppresses a warning in that case. Callers of the functions are then subjected to the same rule. Example `@raises(Exn)` or `@raises([E1, E2, E3])` for multiple exceptions.

### References

Expand Down
15 changes: 15 additions & 0 deletions misc_docs/syntax/decorator_throws.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
id: "throws-decorator"
keywords: ["throws", "decorator"]
name: "@throws"
summary: "This is the `@throws` decorator."
category: "decorators"
---

> This decorator requires [`reanalyze`](https://github.com/rescript-lang/reanalyze), a code analysis tool for ReScript, to be installed. [Click here to read about how you get started with reanalyze.](https://github.com/rescript-lang/reanalyze).

`@throws` is picked up by reanalyze's exception analysis, and acknowledges that a function can throw exceptions that are not caught, and suppresses a warning in that case. Callers of the functions are then subjected to the same rule. Example `@throws(Exn)` or `@throws([E1, E2, E3])` for multiple exceptions.

### References

- [Reanalyze: Exception Analysis](https://github.com/rescript-lang/reanalyze/blob/master/EXCEPTION.md)