File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,10 @@ void caml_string_of_uint8_array () {
272272 caml_fatal_error ("Unimplemented Javascript primitive caml_string_of_uint8_array!" );
273273}
274274
275+ void caml_throw_js_exception () {
276+ caml_fatal_error ("Unimplemented Javascript primitive caml_throw_js_exception!" );
277+ }
278+
275279void caml_unmount () {
276280 caml_fatal_error ("Unimplemented Javascript primitive caml_unmount!" );
277281}
Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ end = struct
177177
178178 let _ = Callback. register_exception " jsError" (Exn (Obj. magic [||]))
179179
180- let raise_ : t -> 'a = Js. js_expr " (function (exn) { throw exn }) "
180+ external raise_ : t -> 'a = " caml_throw_js_exception "
181181
182182 external of_exn : exn -> t option = " caml_js_error_option_of_exception"
183183
Original file line number Diff line number Diff line change @@ -203,6 +203,11 @@ function caml_js_error_option_of_exception(exn) {
203203 return 0 ;
204204}
205205
206+ //Provides: caml_throw_js_exception
207+ function caml_throw_js_exception ( exn ) {
208+ throw exn ;
209+ }
210+
206211//Provides: caml_js_from_bool const (const)
207212function caml_js_from_bool ( x ) {
208213 return ! ! x ;
Original file line number Diff line number Diff line change 7575 (func $wrap_fun_arguments (param anyref ) (result anyref )))
7676 (import " fail" " caml_failwith_tag"
7777 (func $caml_failwith_tag (result (ref eq))))
78+ (import " fail" " javascript_exception"
79+ (tag $javascript_exception (param externref )))
7880 (import " stdlib" " caml_named_value"
7981 (func $caml_named_value (param (ref eq)) (result (ref null eq))))
8082 (import " obj" " caml_callback_1"
666668 (array.get $block (local.get $exn ) (i32.const 2 ))))))))
667669 (ref.i31 (i32.const 0 )))
668670
671+ (func (export " caml_throw_js_exception" )
672+ (param $exn (ref eq)) (result (ref eq))
673+ (throw $javascript_exception
674+ (extern.convert_any (call $unwrap (local.get $exn )))))
675+
669676 (func (export " caml_js_error_of_exception" )
670677 (param (ref eq)) (result (ref eq))
671678 (local $exn (ref $block ))
You can’t perform that action at this time.
0 commit comments