Skip to content

Commit 2b29707

Browse files
committed
snapshot
1 parent d6be8f4 commit 2b29707

File tree

4 files changed

+26
-31
lines changed

4 files changed

+26
-31
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109470,7 +109470,7 @@ val get_default_undefined_from_optional:
109470109470

109471109471
(** Given [Some (`a x)] or [None],
109472109472
return [x] *)
109473-
val get_default_undefined :
109473+
val option_unwrap :
109474109474
J.expression ->
109475109475
J.expression
109476109476

@@ -109598,7 +109598,7 @@ let get_default_undefined_from_optional
109598109598
else
109599109599
(E.runtime_call Js_runtime_modules.option "option_get" [arg])
109600109600

109601-
let get_default_undefined (arg : J.expression) : J.expression =
109601+
let option_unwrap (arg : J.expression) : J.expression =
109602109602
let desc = arg.expression_desc in
109603109603
if is_none_static desc then E.undefined else
109604109604
match desc with
@@ -109607,12 +109607,7 @@ let get_default_undefined (arg : J.expression) : J.expression =
109607109607
Js_of_lam_polyvar.get_field x
109608109608
(* invariant: option encoding *)
109609109609
| _ ->
109610-
(* FIXME: no need do such inlining*)
109611-
if Js_analyzer.is_okay_to_duplicate arg then
109612-
E.econd (is_not_none arg)
109613-
(Js_of_lam_polyvar.get_field (val_from_option arg)) E.undefined
109614-
else
109615-
E.runtime_call Js_runtime_modules.option "option_get_unwrap" [arg]
109610+
E.runtime_call Js_runtime_modules.option "option_unwrap" [arg]
109616109611

109617109612
let destruct_optional
109618109613
~for_sure_none
@@ -110069,8 +110064,10 @@ let ocaml_to_js_eff
110069110064
- if ocaml arg is `None`, let js arg be `undefined` (no unwrapping)
110070110065
- if ocaml arg is `Some x`, unwrap the arg to get the `x`, then
110071110066
unwrap the `x` itself
110067+
- Here `Some x` is `x` due to the current encoding
110068+
Lets inline here since it depends on the runtime encoding
110072110069
*)
110073-
Js_of_lam_option.get_default_undefined raw_arg
110070+
Js_of_lam_option.option_unwrap raw_arg
110074110071
| _ ->
110075110072
Js_of_lam_variant.eval_as_unwrap raw_arg
110076110073
in
@@ -406086,7 +406083,8 @@ let spec_of_ptyp
406086406083
begin match ptyp_desc with
406087406084
| Ptyp_variant (row_fields, Closed, _)
406088406085
when variant_unwrap row_fields ->
406089-
Unwrap
406086+
Unwrap
406087+
(* Unwrap attribute can only be attached to things like `[a of a0 | b of b0]` *)
406090406088
| _ ->
406091406089
Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_unwrap_type
406092406090
end

lib/4.06.1/unstable/js_refmt_compiler.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109470,7 +109470,7 @@ val get_default_undefined_from_optional:
109470109470

109471109471
(** Given [Some (`a x)] or [None],
109472109472
return [x] *)
109473-
val get_default_undefined :
109473+
val option_unwrap :
109474109474
J.expression ->
109475109475
J.expression
109476109476

@@ -109598,7 +109598,7 @@ let get_default_undefined_from_optional
109598109598
else
109599109599
(E.runtime_call Js_runtime_modules.option "option_get" [arg])
109600109600

109601-
let get_default_undefined (arg : J.expression) : J.expression =
109601+
let option_unwrap (arg : J.expression) : J.expression =
109602109602
let desc = arg.expression_desc in
109603109603
if is_none_static desc then E.undefined else
109604109604
match desc with
@@ -109607,12 +109607,7 @@ let get_default_undefined (arg : J.expression) : J.expression =
109607109607
Js_of_lam_polyvar.get_field x
109608109608
(* invariant: option encoding *)
109609109609
| _ ->
109610-
(* FIXME: no need do such inlining*)
109611-
if Js_analyzer.is_okay_to_duplicate arg then
109612-
E.econd (is_not_none arg)
109613-
(Js_of_lam_polyvar.get_field (val_from_option arg)) E.undefined
109614-
else
109615-
E.runtime_call Js_runtime_modules.option "option_get_unwrap" [arg]
109610+
E.runtime_call Js_runtime_modules.option "option_unwrap" [arg]
109616109611

109617109612
let destruct_optional
109618109613
~for_sure_none
@@ -110069,8 +110064,10 @@ let ocaml_to_js_eff
110069110064
- if ocaml arg is `None`, let js arg be `undefined` (no unwrapping)
110070110065
- if ocaml arg is `Some x`, unwrap the arg to get the `x`, then
110071110066
unwrap the `x` itself
110067+
- Here `Some x` is `x` due to the current encoding
110068+
Lets inline here since it depends on the runtime encoding
110072110069
*)
110073-
Js_of_lam_option.get_default_undefined raw_arg
110070+
Js_of_lam_option.option_unwrap raw_arg
110074110071
| _ ->
110075110072
Js_of_lam_variant.eval_as_unwrap raw_arg
110076110073
in
@@ -406086,7 +406083,8 @@ let spec_of_ptyp
406086406083
begin match ptyp_desc with
406087406084
| Ptyp_variant (row_fields, Closed, _)
406088406085
when variant_unwrap row_fields ->
406089-
Unwrap
406086+
Unwrap
406087+
(* Unwrap attribute can only be attached to things like `[a of a0 | b of b0]` *)
406090406088
| _ ->
406091406089
Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_unwrap_type
406092406090
end

lib/4.06.1/unstable/native_ppx.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19196,7 +19196,8 @@ let spec_of_ptyp
1919619196
begin match ptyp_desc with
1919719197
| Ptyp_variant (row_fields, Closed, _)
1919819198
when variant_unwrap row_fields ->
19199-
Unwrap
19199+
Unwrap
19200+
(* Unwrap attribute can only be attached to things like `[a of a0 | b of b0]` *)
1920019201
| _ ->
1920119202
Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_unwrap_type
1920219203
end

lib/4.06.1/whole_compiler.ml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -392165,7 +392165,7 @@ val get_default_undefined_from_optional:
392165392165

392166392166
(** Given [Some (`a x)] or [None],
392167392167
return [x] *)
392168-
val get_default_undefined :
392168+
val option_unwrap :
392169392169
J.expression ->
392170392170
J.expression
392171392171

@@ -392293,7 +392293,7 @@ let get_default_undefined_from_optional
392293392293
else
392294392294
(E.runtime_call Js_runtime_modules.option "option_get" [arg])
392295392295

392296-
let get_default_undefined (arg : J.expression) : J.expression =
392296+
let option_unwrap (arg : J.expression) : J.expression =
392297392297
let desc = arg.expression_desc in
392298392298
if is_none_static desc then E.undefined else
392299392299
match desc with
@@ -392302,12 +392302,7 @@ let get_default_undefined (arg : J.expression) : J.expression =
392302392302
Js_of_lam_polyvar.get_field x
392303392303
(* invariant: option encoding *)
392304392304
| _ ->
392305-
(* FIXME: no need do such inlining*)
392306-
if Js_analyzer.is_okay_to_duplicate arg then
392307-
E.econd (is_not_none arg)
392308-
(Js_of_lam_polyvar.get_field (val_from_option arg)) E.undefined
392309-
else
392310-
E.runtime_call Js_runtime_modules.option "option_get_unwrap" [arg]
392305+
E.runtime_call Js_runtime_modules.option "option_unwrap" [arg]
392311392306

392312392307
let destruct_optional
392313392308
~for_sure_none
@@ -392764,8 +392759,10 @@ let ocaml_to_js_eff
392764392759
- if ocaml arg is `None`, let js arg be `undefined` (no unwrapping)
392765392760
- if ocaml arg is `Some x`, unwrap the arg to get the `x`, then
392766392761
unwrap the `x` itself
392762+
- Here `Some x` is `x` due to the current encoding
392763+
Lets inline here since it depends on the runtime encoding
392767392764
*)
392768-
Js_of_lam_option.get_default_undefined raw_arg
392765+
Js_of_lam_option.option_unwrap raw_arg
392769392766
| _ ->
392770392767
Js_of_lam_variant.eval_as_unwrap raw_arg
392771392768
in
@@ -409825,7 +409822,8 @@ let spec_of_ptyp
409825409822
begin match ptyp_desc with
409826409823
| Ptyp_variant (row_fields, Closed, _)
409827409824
when variant_unwrap row_fields ->
409828-
Unwrap
409825+
Unwrap
409826+
(* Unwrap attribute can only be attached to things like `[a of a0 | b of b0]` *)
409829409827
| _ ->
409830409828
Bs_syntaxerr.err ptyp.ptyp_loc Invalid_bs_unwrap_type
409831409829
end

0 commit comments

Comments
 (0)