Skip to content

Commit 8fa4b5a

Browse files
committed
Only accept res.async and clean up Js_promise.
1 parent fd6d982 commit 8fa4b5a

File tree

7 files changed

+24
-30
lines changed

7 files changed

+24
-30
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(* 36f75a243bf355743b28ba056b91fc39 *)
1+
(* bbc431e9b244ec97eae63a9bfe698f48 *)
22
let module_names : string array = Obj.magic (
33
"Js" (* 23 *),
44
"Arg" (* 217 *),
@@ -196,7 +196,7 @@ let module_data : string array = Obj.magic (
196196
(* Belt_Float *)"\132\149\166\190\000\000\000\022\000\000\000\007\000\000\000\021\000\000\000\020\160\144\176*fromString\144\160\160A@@@A",
197197
(* Belt_Range *)"\132\149\166\190\000\000\000\160\000\000\0004\000\000\000\166\000\000\000\156\160\b\000\000(\000\176$some\144\160\160C@@@\176%every\144\160\160C@@@\176%someU\144\160\160C@@@\176&everyU\144\160\160C@@@\176&someBy\144\160\160D@@@\176'everyBy\144\160\160D@@@\176'forEach\144\160\160C@@@\176'someByU\144\160\160D@@@\176(everyByU\144\160\160D@@@\176(forEachU\144\160\160C@@@A",
198198
(* Js_console *)"\132\149\166\190\000\000\000\003\000\000\000\001\000\000\000\003\000\000\000\003\160\128A",
199-
(* Js_promise *)"\132\149\166\190\000\000\000\252\000\000\000J\000\000\000\243\000\000\000\232\160\160\176%catch\144\160\160B@@\144\148\192B\160\176\001\003\254$arg1@\160\176\001\003\255#obj@@\151\176\180%catch\160\160AA\160\160AA@\181%catch@@\160\144\004\014\160\151\176\b\000\000\004\016A\160\144\004\023@\176\1924others/js_promise.ml\000T\001\011g\001\011g\192\004\002\000U\001\011\169\001\011\193@@\004\004\208B@@@@\176%then_\144\160\160B@@\144\148\192B\160\176\001\003\249$arg1@\160\176\001\003\250\004%@@\151\176\180$then\160\160AA\160\160AA@\181$then@@\160\144\004\r\160\151\176\b\000\000\004\016A\160\144\004\022@\176\192\004$\000Q\001\011\015\001\011\015\192\004%\000R\001\011M\001\011e@@\004\003\208B@@@@A",
199+
(* Js_promise *)"\132\149\166\190\000\000\000\252\000\000\000J\000\000\000\243\000\000\000\232\160\160\176%catch\144\160\160B@@\144\148\192B\160\176\001\003\253$arg1@\160\176\001\003\254#obj@@\151\176\180%catch\160\160AA\160\160AA@\181%catch@@\160\144\004\014\160\151\176\b\000\000\004\016A\160\144\004\023@\176\1924others/js_promise.ml\000Q\001\011\018\001\011\018\192\004\002\000R\001\011T\001\011l@@\004\004\208B@@@@\176%then_\144\160\160B@@\144\148\192B\160\176\001\003\248$arg1@\160\176\001\003\249\004%@@\151\176\180$then\160\160AA\160\160AA@\181$then@@\160\144\004\r\160\151\176\b\000\000\004\016A\160\144\004\022@\176\192\004$\000N\001\n\186\001\n\186\192\004%\000O\001\n\248\001\011\016@@\004\003\208B@@@@A",
200200
(* Js_string2 *)"\132\149\166\190\000\000\000\003\000\000\000\001\000\000\000\003\000\000\000\003\160\128A",
201201
(* ListLabels *)"\132\149\166\190\000\000\003\148\000\000\001\022\000\000\003\147\000\000\003_\160\b\000\000\208\000\176\"hd\144\160\160A@@@\176\"tl\144\160\160A@@@\176#map\144\160\160B@@@\176#mem\144\160\160B@@@\176#nth\144\160\160B@@@\176#rev\144\160\160A@@@\176$assq\144\160\160B@@@\176$cons\144\160\160B@@\144\148\192B\160\176\001\003\241!a@\160\176\001\003\242!l@@\151\176\176@\176\"::A@@\160\144\004\012\160\144\004\011@\176\1928stdlib-406/listLabels.mlX\001\004\193\001\004\208\192\004\002X\001\004\193\001\004\212@\208B@@@@\176$find\144\160\160B@@@\176$init\144\160\160B@@@\176$iter\144\160\160B@@@\176$map2\144\160\160C@@@\176$mapi\144\160\160B@@@\176$memq\144\160\160B@@@\176$sort\144\160\160B@@@\176%assoc\144\160\160B@@@\176%iter2\144\160\160C@@@\176%iteri\144\160\160B@@@\176%merge\144\160\160C@@@\176%split\144\160\160A@@@\176&append\144\160\160B@@@\176&concat\144\160\160A@@@\176&exists\144\160\160B@@@\176&filter\144\160\160A\160A@@@\176&length\144\160\160A@@@\176'combine\144\160\160B@@@\176'exists2\144\160\160C@@@\176'flatten\144\004\031@\176'for_all\144\160\160B@@@\176'nth_opt\144\160\160B@@@\176'rev_map\144\160\160B@@@\176(assq_opt\144\160\160B@@@\176(find_all\144\004,@\176(find_opt\144\160\160B@@@\176(for_all2\144\160\160C@@@\176(mem_assq\144\160\160B@@@\176(rev_map2\144\160\160C@@@\176)assoc_opt\144\160\160B@@@\176)fast_sort\144\004u@\176)fold_left\144\160\160C@@@\176)mem_assoc\144\160\160B@@@\176)partition\144\160\160B@@@\176)sort_uniq\144\160\160B@@@\176*fold_left2\144\160\160D@@@\176*fold_right\144\160\160C@@@\176*rev_append\144\160\160B@@@\176+fold_right2\144\160\160D@@@\176+remove_assq\144\160\160B@@@\176+stable_sort\144\004\165@\176,remove_assoc\144\160\160B@@@\176/compare_lengths\144\160\160B@@@\1763compare_length_with\144\160\160B@@@A",
202202
(* MoreLabels *)"\132\149\166\190\000\000\000\165\000\000\000B\000\000\000\217\000\000\000\216\160\176\176#Map\145\144\160\160A@@@\176#Set\145\144\160\160A@@@\176'Hashtbl\145\b\000\000`\000\160\160B@@\160\160A@@\160\160A@@\160\160A@@\160\160C@@\160\160B@@\160\160B@@\160\160B@@\160\160B@@\160\160B@@\160\160C@@\160\160B@@\160\160B@@\160\160C@@\160\160A@@\160\160A@@\160\160A@@\160\160A@@\160\160A@@\160\160A@@\160\160A@@\160\160B@@\160\160C@@\160\160D@@@A",

jscomp/ml/translcore.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda =
696696
| Texp_let (rec_flag, pat_expr_list, body) ->
697697
transl_let rec_flag pat_expr_list (transl_exp body)
698698
| Texp_function { arg_label = _; param; cases; partial } ->
699-
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "async" || txt = "res.async") in
699+
let async = e.exp_attributes |> List.exists (fun ({txt}, _payload) -> txt = "res.async") in
700700
let params, body, return_unit =
701701
let pl = push_defaults e.exp_loc [] cases partial in
702702
transl_function e.exp_loc partial param pl

jscomp/others/js_promise.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ external all4 : 'a0 t * 'a1 t * 'a2 t * 'a3 t -> ('a0 * 'a1 * 'a2 * 'a3) t
6363
= "all"
6464
[@@bs.val] [@@bs.scope "Promise"]
6565

66-
external then2 : 'a t -> (('a -> 'b t)[@bs.uncurry]) -> 'b t = "then"
67-
[@@bs.send]
68-
6966
external all5 :
7067
'a0 t * 'a1 t * 'a2 t * 'a3 t * 'a4 t -> ('a0 * 'a1 * 'a2 * 'a3 * 'a4) t
7168
= "all"
@@ -90,9 +87,6 @@ external catch : ((error -> 'a t)[@bs.uncurry]) -> 'a t = "catch"
9087
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
9188
*)
9289

93-
external catch2 : 'a t -> ((exn -> 'a t)[@bs.uncurry]) -> 'a t = "catch"
94-
[@@bs.send]
95-
9690
external unsafe_async : 'a -> 'a t = "%identity"
9791
external unsafe_await : 'a t -> 'a = "?await"
9892

lib/4.06.1/unstable/js_compiler.ml

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

lib/4.06.1/unstable/js_playground_compiler.ml

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

lib/4.06.1/whole_compiler.ml

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

0 commit comments

Comments
 (0)