Skip to content

Commit 7ddef8e

Browse files
committed
snapshot js_exn changes
1 parent a011d58 commit 7ddef8e

File tree

8 files changed

+339
-449
lines changed

8 files changed

+339
-449
lines changed

jscomp/main/builtin_cmi_datasets.ml

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

jscomp/main/builtin_cmj_datasets.ml

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

jscomp/others/js_exn.ml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ external makeError : string -> error = "Error" [@@bs.new]
4545
external isCamlExceptionOrOpenVariant :
4646
'a -> bool = "caml_is_extension"
4747

48-
let anyToExnInternal obj =
49-
if isCamlExceptionOrOpenVariant obj then
50-
(Obj.magic obj : exn)
51-
else
52-
Error ((Obj.magic obj) : t)
48+
let anyToExnInternal x =
49+
Caml_js_exceptions.internalToOCamlException (Obj.repr x)
50+
5351

5452
let raiseError str =
5553
raise (Obj.magic (makeError str : error) : exn)

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 108 additions & 146 deletions
Large diffs are not rendered by default.

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 108 additions & 146 deletions
Large diffs are not rendered by default.

lib/4.06.1/whole_compiler.ml

Lines changed: 108 additions & 146 deletions
Large diffs are not rendered by default.

lib/es6/js_exn.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import * as Caml_js_exceptions from "./caml_js_exceptions.mjs";
44

5+
var anyToExnInternal = Caml_js_exceptions.internalToOCamlException;
6+
57
function raiseError(str) {
68
throw new Error(str);
79
}
@@ -34,6 +36,7 @@ var $$Error$1 = Caml_js_exceptions.$$Error;
3436

3537
export {
3638
$$Error$1 as $$Error,
39+
anyToExnInternal ,
3740
raiseError ,
3841
raiseEvalError ,
3942
raiseRangeError ,

lib/js/js_exn.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
var Caml_js_exceptions = require("./caml_js_exceptions.js");
44

5+
var anyToExnInternal = Caml_js_exceptions.internalToOCamlException;
6+
57
function raiseError(str) {
68
throw new Error(str);
79
}
@@ -33,6 +35,7 @@ function raiseUriError(str) {
3335
var $$Error$1 = Caml_js_exceptions.$$Error;
3436

3537
exports.$$Error = $$Error$1;
38+
exports.anyToExnInternal = anyToExnInternal;
3639
exports.raiseError = raiseError;
3740
exports.raiseEvalError = raiseEvalError;
3841
exports.raiseRangeError = raiseRangeError;

0 commit comments

Comments
 (0)