From aab63efdb1a362cefcdcda53d12309ec664158d6 Mon Sep 17 00:00:00 2001 From: Bao Zhiyuan Date: Wed, 5 Mar 2025 17:12:01 +0800 Subject: [PATCH] tweak promise ffi --- src/js/async.mbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/async.mbt b/src/js/async.mbt index 6ce3f23..7e1fda3 100644 --- a/src/js/async.mbt +++ b/src/js/async.mbt @@ -17,7 +17,7 @@ extern "js" fn async_wrap_ffi( op : AsyncOp, on_ok : (Value) -> Unit, on_err : (Value) -> Unit -) -> Unit = "(op, on_ok, on_err) => op().then((t) => on_ok(t)).catch((e) => on_err(e))" +) -> Unit = "(op, on_ok, on_err) => op().then((t) => on_ok(t), (e) => on_err(e))" ///| pub async fn async_wrap(op : AsyncOp) -> Value! {