@@ -239,7 +239,14 @@ class map : mapper =
239239 match m#statement (Class_declaration (id, f)) with
240240 | Class_declaration (id , f ) -> ExportClass (id, f)
241241 | _ -> assert false )
242- | ExportNames l -> ExportNames (List. map ~f: (fun (id , s ) -> m#ident id, s) l)
242+ | ExportNames l ->
243+ ExportNames
244+ (List. map
245+ ~f: (fun (id , s ) ->
246+ match m#expression (EVar id) with
247+ | EVar id -> id, s
248+ | _ -> assert false )
249+ l)
243250 | ExportDefaultFun (Some id , decl ) -> (
244251 match m#statement (Function_declaration (id, decl)) with
245252 | Function_declaration (id , decl ) -> ExportDefaultFun (Some id, decl)
@@ -1020,6 +1027,20 @@ class free =
10201027 cbody#record_block Normal ;
10211028 m#merge_block_info cbody;
10221029 EClass (ident_o, cl_decl)
1030+ | EAssignTarget (ArrayTarget l ) ->
1031+ List. iter l ~f: (function
1032+ | TargetElementHole -> ()
1033+ | TargetElementId (i , _ ) -> m#use_var i
1034+ | TargetElement _ -> ()
1035+ | TargetElementSpread _ -> () );
1036+ super#expression x
1037+ | EAssignTarget (ObjectTarget l ) ->
1038+ List. iter l ~f: (function
1039+ | TargetPropertyId (Prop_and_ident i , _ ) -> m#use_var i
1040+ | TargetProperty _ -> ()
1041+ | TargetPropertyMethod _ -> ()
1042+ | TargetPropertySpread _ -> () );
1043+ super#expression x
10231044 | _ -> super#expression x
10241045
10251046 method record_block _ = ()
0 commit comments