@@ -63,15 +63,14 @@ let record_as_js_object = ref false (* otherwise has an attribute *)
63
63
64
64
65
65
let obj_type_as_js_obj_type = ref false
66
- let uncurry_type = ref false
66
+
67
67
68
68
let no_export = ref false
69
69
70
70
71
71
let reset () =
72
72
record_as_js_object := false ;
73
73
obj_type_as_js_obj_type := false ;
74
- uncurry_type := false ;
75
74
no_export := false
76
75
77
76
@@ -188,78 +187,46 @@ let handle_typ
188
187
| `Method , ptyp_attributes ->
189
188
Ast_util. to_method_type loc self label args body
190
189
| `Nothing , _ ->
191
- if ! uncurry_type then
192
- Ast_util. to_uncurry_type loc self label args body
193
- else
194
190
Ast_mapper. default_mapper.typ self ty
195
191
end
196
192
| {
197
193
ptyp_desc = Ptyp_object ( methods, closed_flag) ;
198
- ptyp_attributes ;
199
194
ptyp_loc = loc
200
195
} ->
201
196
202
197
let check_auto_uncurry core_type = self.typ self core_type in
203
- let methods, ptyp_attributes =
204
- begin match Ext_list. exclude_with_fact
205
- (function
206
- | {Location. txt = "bs" ; _} , _ -> true
207
- | _ -> false )
208
- ptyp_attributes with
209
- | None , _ ->
210
- List. map (fun (label , ptyp_attrs , core_type ) ->
211
- match Ast_attributes. process_attributes_rev ptyp_attrs with
212
- | `Nothing , _ ->
213
- label, ptyp_attrs , check_auto_uncurry core_type
214
- | `Uncurry , _ ->
215
- label , ptyp_attrs,
216
- check_auto_uncurry
217
- { core_type with
218
- ptyp_attributes =
219
- Ast_attributes. bs :: core_type .ptyp_attributes}
220
- | `Method , ptyp_attrs
221
- ->
222
- label , ptyp_attrs,
223
- check_auto_uncurry
224
- { core_type with
225
- ptyp_attributes =
226
- Ast_attributes. bs_method :: core_type .ptyp_attributes}
227
- | `Meth_callback , ptyp_attrs
228
- ->
229
- label , ptyp_attrs,
230
- check_auto_uncurry
231
- { core_type with
232
- ptyp_attributes =
233
- Ast_attributes. bs_this :: core_type .ptyp_attributes}
234
- ) methods , ptyp_attributes
235
- | Some _ , ptyp_attributes ->
236
- Ext_ref. non_exn_protect uncurry_type true begin fun _ ->
237
- List. map (fun (label , ptyp_attrs , core_type ) ->
238
- match Ast_attributes. process_attributes_rev ptyp_attrs with
239
- | `Nothing , _ -> label, ptyp_attrs , self.typ self core_type
240
- | `Uncurry , ptyp_attrs ->
241
- label , ptyp_attrs, self.typ self
242
- { core_type with
243
- ptyp_attributes =
244
- Ast_attributes. bs :: core_type .ptyp_attributes}
245
- | `Method , ptyp_attrs ->
246
- label , ptyp_attrs, self.typ self
247
- { core_type with
248
- ptyp_attributes =
249
- Ast_attributes. bs_method :: core_type .ptyp_attributes}
250
- | `Meth_callback , ptyp_attrs ->
251
- label , ptyp_attrs, self.typ self
252
- { core_type with
253
- ptyp_attributes =
254
- Ast_attributes. bs_this :: core_type .ptyp_attributes}
255
- ) methods
256
- end, ptyp_attributes
257
- end
198
+ let methods =
199
+ List. map (fun (label , ptyp_attrs , core_type ) ->
200
+ match Ast_attributes. process_attributes_rev ptyp_attrs with
201
+ | `Nothing , _ ->
202
+ label, ptyp_attrs , check_auto_uncurry core_type
203
+ | `Uncurry , _ ->
204
+ label , ptyp_attrs,
205
+ check_auto_uncurry
206
+ { core_type with
207
+ ptyp_attributes =
208
+ Ast_attributes. bs :: core_type .ptyp_attributes}
209
+ | `Method , ptyp_attrs
210
+ ->
211
+ label , ptyp_attrs,
212
+ check_auto_uncurry
213
+ { core_type with
214
+ ptyp_attributes =
215
+ Ast_attributes. bs_method :: core_type .ptyp_attributes}
216
+ | `Meth_callback , ptyp_attrs
217
+ ->
218
+ label , ptyp_attrs,
219
+ check_auto_uncurry
220
+ { core_type with
221
+ ptyp_attributes =
222
+ Ast_attributes. bs_this :: core_type .ptyp_attributes}
223
+ ) methods
224
+
258
225
in
259
226
let inner_type =
260
227
{ ty
261
228
with ptyp_desc = Ptyp_object (methods, closed_flag);
262
- ptyp_attributes } in
229
+ } in
263
230
if ! obj_type_as_js_obj_type then
264
231
Ast_comb. to_js_type loc inner_type
265
232
else inner_type
0 commit comments