Skip to content

Commit

Permalink
re-port has_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Nov 22, 2024
1 parent dd6f2bb commit bdaf973
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/generators/gctx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ let rec has_feature gctx f =
(match List.find (fun t -> t_path t = path && not (Meta.has Meta.RealPath (t_infos t).mt_meta)) gctx.types with
| t when field = "*" ->
not (has_dce gctx) ||
(match t with TAbstractDecl a -> Meta.has Meta.ValueUsed a.a_meta | _ -> Meta.has Meta.Used (t_infos t).mt_meta)
begin match t with
| TClassDecl c ->
has_class_flag c CUsed;
| TAbstractDecl a ->
Meta.has Meta.ValueUsed a.a_meta
| _ -> Meta.has Meta.Used (t_infos t).mt_meta
end;
| TClassDecl c when (has_class_flag c CExtern) && (gctx.platform <> Js || cl <> "Array" && cl <> "Math") ->
not (has_dce gctx) || Meta.has Meta.Used (try PMap.find field c.cl_statics with Not_found -> PMap.find field c.cl_fields).cf_meta
not (has_dce gctx) || has_class_field_flag (try PMap.find field c.cl_statics with Not_found -> PMap.find field c.cl_fields) CfUsed
| TClassDecl c ->
PMap.exists field c.cl_statics || PMap.exists field c.cl_fields
| _ ->
Expand Down

0 comments on commit bdaf973

Please sign in to comment.