We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3a896a commit 2bc9676Copy full SHA for 2bc9676
jscomp/core/js_dump.ml
@@ -319,7 +319,16 @@ and pp_function ~return_unit ~is_method cxt (f : P.t) ~fn_state
319
{[ function(x,y){ return u(x,y) } ]}
320
it can be optimized in to either [u] or [Curry.__n(u)]
321
*)
322
- (not is_method) && Ext_list.for_all2_no_exn ls l is_var -> (
+ (not is_method)
323
+ && Ext_list.for_all2_no_exn ls l is_var
324
+ &&
325
+ match v with
326
+ (* This check is needed to avoid some edge cases
327
+ {[function(x){return x(x)}]}
328
+ here the function is also called `x`
329
+ *)
330
+ | Id id -> not (Ext_list.exists l (fun x -> Ident.same x id))
331
+ | Qualified _ -> true -> (
332
let optimize len ~p cxt f v =
333
if p then try_optimize_curry cxt f len function_id else vident cxt f v
334
in
0 commit comments