Skip to content

Commit 884e1c6

Browse files
committed
Remove obsolete "bs.open" feature
1 parent 1b50793 commit 884e1c6

File tree

5 files changed

+2
-123
lines changed

5 files changed

+2
-123
lines changed

jscomp/frontend/ast_attributes.ml

-7
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ let process_attributes_rev (attrs : t) : attr_kind * t =
9393
Bs_syntaxerr.err loc Conflict_bs_bs_this_bs_meth
9494
| _, _ -> (st, attr :: acc))
9595

96-
let process_pexp_fun_attributes_rev (attrs : t) =
97-
Ext_list.fold_left attrs (false, [])
98-
(fun (st, acc) (({txt; loc = _}, _) as attr) ->
99-
match txt with
100-
| "bs.open" -> (true, acc)
101-
| _ -> (st, attr :: acc))
102-
10396
let process_bs (attrs : t) =
10497
Ext_list.fold_left attrs (false, [])
10598
(fun (st, acc) (({txt; loc = _}, _) as attr) ->

jscomp/frontend/ast_attributes.mli

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ type attr_kind =
3737

3838
val process_attributes_rev : t -> attr_kind * t
3939

40-
val process_pexp_fun_attributes_rev : t -> bool * t
41-
4240
val process_bs : t -> bool * t
4341

4442
val has_inline_payload : t -> attr option

jscomp/frontend/ast_bs_open.ml

-75
This file was deleted.

jscomp/frontend/ast_bs_open.mli

-30
This file was deleted.

jscomp/frontend/bs_builtin_ppx.ml

+2-9
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,9 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
110110
| Pexp_constant (Pconst_integer (s, Some 'l')) ->
111111
{e with pexp_desc = Pexp_constant (Pconst_integer (s, None))}
112112
(* End rewriting *)
113-
| Pexp_function cases -> (
114-
(* {[ function [@bs.exn]
115-
| Not_found -> 0
116-
| Invalid_argument -> 1
117-
]}*)
113+
| Pexp_function _ ->
118114
async_context := false;
119-
match Ast_attributes.process_pexp_fun_attributes_rev e.pexp_attributes with
120-
| false, _ -> default_expr_mapper self e
121-
| true, pexp_attributes ->
122-
Ast_bs_open.convertBsErrorFunction e.pexp_loc self pexp_attributes cases)
115+
default_expr_mapper self e
123116
| _
124117
when Ast_uncurried.exprIsUncurriedFun e
125118
&&

0 commit comments

Comments
 (0)