Skip to content

Commit c41db5c

Browse files
committed
sync Reanalyze with the new API around exception
1 parent 38414ac commit c41db5c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

analysis/reanalyze/src/ExnLib.ml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,22 @@ let raisesLibTable : (Name.t, Exceptions.t) Hashtbl.t =
6363
("fromStringOrThrow", [invalidArgument]);
6464
]
6565
in
66-
let stdlibError = [("raise", [jsExn])] in
66+
let stdlibJsError =
67+
[
68+
("EvalError.throwWithMessage", [jsExn]);
69+
("RangeError.throwWithMessage", [jsExn]);
70+
("ReferenceError.throwWithMessage", [jsExn]);
71+
("SyntaxError.throwWithMessage", [jsExn]);
72+
("TypeError.throwWithMessage", [jsExn]);
73+
("URIError.throwWithMessage", [jsExn]);
74+
("panic", [jsExn]);
75+
("throw", [jsExn]);
76+
("throwWithMessage", [jsExn]);
77+
]
78+
in
79+
let stdlibError =
80+
[("raise", [jsExn]); ("panic", [jsExn]); ("throw", [jsExn])]
81+
in
6782
let stdlibExn =
6883
[
6984
("raiseError", [jsExn]);
@@ -156,6 +171,7 @@ let raisesLibTable : (Name.t, Exceptions.t) Hashtbl.t =
156171
("Bool", stdlibBool);
157172
("Error", stdlibError);
158173
("Exn", stdlibExn);
174+
("JsError", stdlibJsError);
159175
("Js.Json", [("parseExn", [jsExn])]);
160176
("JSON", stdlibJson);
161177
("Json_decode", bsJson);
@@ -178,6 +194,8 @@ let raisesLibTable : (Name.t, Exceptions.t) Hashtbl.t =
178194
("Stdlib.Error", stdlibError);
179195
("Stdlib_Exn", stdlibExn);
180196
("Stdlib.Exn", stdlibExn);
197+
("Stdlib_JsError", stdlibJsError);
198+
("Stdlib.JsError", stdlibJsError);
181199
("Stdlib_JSON", stdlibJson);
182200
("Stdlib.JSON", stdlibJson);
183201
("Stdlib_List", stdlibList);

0 commit comments

Comments
 (0)