Skip to content

sync Reanalyze with the new API around exception #7536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
- In module declarations, accept the invalid syntax `M = {...}` and format it to `M : {...}`. https://github.com/rescript-lang/rescript/pull/7527
- Improve doc comment formatting to match the style of multiline comments. https://github.com/rescript-lang/rescript/pull/7529
- Improve error messages around type mismatches for try/catch, if, for, while, and optional record fields + optional function arguments. https://github.com/rescript-lang/rescript/pull/7522
- sync Reanalyze with the new APIs around exception. https://github.com/rescript-lang/rescript/pull/7536

#### :house: Internal

Expand Down
20 changes: 19 additions & 1 deletion analysis/reanalyze/src/ExnLib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,22 @@ let raisesLibTable : (Name.t, Exceptions.t) Hashtbl.t =
("fromStringOrThrow", [invalidArgument]);
]
in
let stdlibError = [("raise", [jsExn])] in
let stdlibJsError =
[
("EvalError.throwWithMessage", [jsExn]);
("RangeError.throwWithMessage", [jsExn]);
("ReferenceError.throwWithMessage", [jsExn]);
("SyntaxError.throwWithMessage", [jsExn]);
("TypeError.throwWithMessage", [jsExn]);
("URIError.throwWithMessage", [jsExn]);
("panic", [jsExn]);
("throw", [jsExn]);
("throwWithMessage", [jsExn]);
]
in
let stdlibError =
[("raise", [jsExn]); ("panic", [jsExn]); ("throw", [jsExn])]
in
let stdlibExn =
[
("raiseError", [jsExn]);
Expand Down Expand Up @@ -156,6 +171,7 @@ let raisesLibTable : (Name.t, Exceptions.t) Hashtbl.t =
("Bool", stdlibBool);
("Error", stdlibError);
("Exn", stdlibExn);
("JsError", stdlibJsError);
("Js.Json", [("parseExn", [jsExn])]);
("JSON", stdlibJson);
("Json_decode", bsJson);
Expand All @@ -178,6 +194,8 @@ let raisesLibTable : (Name.t, Exceptions.t) Hashtbl.t =
("Stdlib.Error", stdlibError);
("Stdlib_Exn", stdlibExn);
("Stdlib.Exn", stdlibExn);
("Stdlib_JsError", stdlibJsError);
("Stdlib.JsError", stdlibJsError);
("Stdlib_JSON", stdlibJson);
("Stdlib.JSON", stdlibJson);
("Stdlib_List", stdlibList);
Expand Down