Skip to content

Commit 49a992d

Browse files
committed
Fix JS deprecations
1 parent 72a35a4 commit 49a992d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/lib/crypto/kimchi_bindings/js/node_js/node_backend.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ var wasm_ready = function(wasm) {
3434
wasm.wbg_rayon_start_worker(worker_threads.workerData.receiver);
3535
};
3636

37+
// This function was previously exported by JSOO but was removed.
38+
// It is now copied here.
39+
// Provides: caml_js_export_var
40+
function caml_js_export_var (){
41+
if(typeof module !== 'undefined' && module && module.exports)
42+
return module.exports
43+
else
44+
return globalThis;
45+
}
46+
3747
// Provides: startWorkers
3848
// Requires: worker_threads, _workers, caml_js_export_var
3949
var startWorkers = (function() {

src/lib/snarky_js_bindings/lib/snarky_js_bindings_lib.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ let console_log_string s = Js_of_ocaml.Firebug.console##log (Js.string s)
1414
let console_log s = Js_of_ocaml.Firebug.console##log s
1515

1616
let raise_error s =
17-
let s = Js.string s in
18-
Js.raise_js_error (new%js Js.error_constr s)
17+
Js_error.(raise_ @@ of_error (new%js Js.error_constr (Js.string s)))
1918

2019
let raise_errorf fmt = Core_kernel.ksprintf raise_error fmt
2120

0 commit comments

Comments
 (0)