Skip to content

Commit 688731a

Browse files
committed
Remove unused env argument
1 parent ad15635 commit 688731a

File tree

6 files changed

+12
-18
lines changed

6 files changed

+12
-18
lines changed

jscomp/core/js_implementation.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ let after_parsing_impl ppf outputprefix ast =
141141
let env = Compmisc.initial_env() in
142142
Env.set_unit_name modulename;
143143

144-
let (typedtree, coercion, finalenv, current_signature) =
144+
let (typedtree, coercion, _, _) =
145145
ast
146146
|> Typemod.type_implementation_more ?check_exists:(if !Js_config.force_cmi then None else Some ()) !Location.input_name outputprefix modulename env
147147
|> print_if ppf Clflags.dump_typedtree
@@ -155,7 +155,7 @@ let after_parsing_impl ppf outputprefix ast =
155155
|> (fun lambda ->
156156
let js_program =
157157
print_if ppf Clflags.dump_rawlambda Printlambda.lambda (get_lambda lambda)
158-
|> Lam_compile_main.compile outputprefix finalenv in
158+
|> Lam_compile_main.compile outputprefix in
159159
if not !Js_config.cmj_only then
160160
Lam_compile_main.lambda_as_module
161161
js_program

jscomp/core/lam_compile_main.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ let _d = fun s lam ->
131131
*)
132132
let compile
133133
(output_prefix : string)
134-
(env : Env.t)
135134
(lam : Lambda.lambda) =
136135
let export_idents = Translmod.get_export_identifiers() in
137136
let export_ident_sets = Ident_set.of_list export_idents in

jscomp/core/lam_compile_main.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
*)
4040
val compile :
4141
string ->
42-
Env.t ->
4342
Lambda.lambda ->
4443
J.deps_program
4544

jscomp/main/jsoo_main.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ let implementation ~use_super_errors ?(react_ppx_version=V3) prefix impl str :
8080
(* Env.set_unit_name modulename; *)
8181
Lam_compile_env.reset () ;
8282
let env = Compmisc.initial_env() in (* Question ?? *)
83-
let finalenv = ref Env.empty in
83+
(* let finalenv = ref Env.empty in *)
8484
let types_signature = ref [] in
8585
if use_super_errors then begin
8686
Misc.Color.setup (Some Always);
@@ -99,8 +99,8 @@ let implementation ~use_super_errors ?(react_ppx_version=V3) prefix impl str :
9999
| V3 -> Reactjs_jsx_ppx_v3.rewrite_implementation ast in
100100
let ast = Bs_builtin_ppx.rewrite_implementation ast in
101101
let typed_tree =
102-
let (a,b,c,signature) = Typemod.type_implementation_more modulename modulename modulename env ast in
103-
finalenv := c ;
102+
let (a,b,_,signature) = Typemod.type_implementation_more modulename modulename modulename env ast in
103+
(* finalenv := c ; *)
104104
types_signature := signature;
105105
(a,b) in
106106
typed_tree
@@ -117,7 +117,7 @@ let implementation ~use_super_errors ?(react_ppx_version=V3) prefix impl str :
117117
~output_prefix:"" (* does not matter here *)
118118
NodeJS
119119
(Lam_compile_main.compile ""
120-
!finalenv lam)
120+
lam)
121121
(Ext_pp.from_buffer buffer) in
122122
let v = Buffer.contents buffer in
123123
Js.Unsafe.(obj [| "js_code", inject @@ Js.string v |]) )

lib/4.02.3/unstable/js_compiler.ml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115938,7 +115938,6 @@ module Lam_compile_main : sig
115938115938
*)
115939115939
val compile :
115940115940
string ->
115941-
Env.t ->
115942115941
Lambda.lambda ->
115943115942
J.deps_program
115944115943

@@ -116077,7 +116076,6 @@ let _d = fun s lam ->
116077116076
*)
116078116077
let compile
116079116078
(output_prefix : string)
116080-
(env : Env.t)
116081116079
(lam : Lambda.lambda) =
116082116080
let export_idents = Translmod.get_export_identifiers() in
116083116081
let export_ident_sets = Ident_set.of_list export_idents in
@@ -119880,7 +119878,7 @@ let implementation ~use_super_errors ?(react_ppx_version=V3) prefix impl str :
119880119878
(* Env.set_unit_name modulename; *)
119881119879
Lam_compile_env.reset () ;
119882119880
let env = Compmisc.initial_env() in (* Question ?? *)
119883-
let finalenv = ref Env.empty in
119881+
(* let finalenv = ref Env.empty in *)
119884119882
let types_signature = ref [] in
119885119883
if use_super_errors then begin
119886119884
Misc.Color.setup (Some Always);
@@ -119899,8 +119897,8 @@ let implementation ~use_super_errors ?(react_ppx_version=V3) prefix impl str :
119899119897
| V3 -> Reactjs_jsx_ppx_v3.rewrite_implementation ast in
119900119898
let ast = Bs_builtin_ppx.rewrite_implementation ast in
119901119899
let typed_tree =
119902-
let (a,b,c,signature) = Typemod.type_implementation_more modulename modulename modulename env ast in
119903-
finalenv := c ;
119900+
let (a,b,_,signature) = Typemod.type_implementation_more modulename modulename modulename env ast in
119901+
(* finalenv := c ; *)
119904119902
types_signature := signature;
119905119903
(a,b) in
119906119904
typed_tree
@@ -119915,7 +119913,7 @@ let implementation ~use_super_errors ?(react_ppx_version=V3) prefix impl str :
119915119913
~output_prefix:"" (* does not matter here *)
119916119914
NodeJS
119917119915
(Lam_compile_main.compile ""
119918-
!finalenv lam)
119916+
lam)
119919119917
(Ext_pp.from_buffer buffer) in
119920119918
let v = Buffer.contents buffer in
119921119919
Js.Unsafe.(obj [| "js_code", inject @@ Js.string v |]) )

lib/4.02.3/whole_compiler.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113647,7 +113647,6 @@ module Lam_compile_main : sig
113647113647
*)
113648113648
val compile :
113649113649
string ->
113650-
Env.t ->
113651113650
Lambda.lambda ->
113652113651
J.deps_program
113653113652

@@ -113786,7 +113785,6 @@ let _d = fun s lam ->
113786113785
*)
113787113786
let compile
113788113787
(output_prefix : string)
113789-
(env : Env.t)
113790113788
(lam : Lambda.lambda) =
113791113789
let export_idents = Translmod.get_export_identifiers() in
113792113790
let export_ident_sets = Ident_set.of_list export_idents in
@@ -123085,7 +123083,7 @@ let after_parsing_impl ppf outputprefix ast =
123085123083
let env = Compmisc.initial_env() in
123086123084
Env.set_unit_name modulename;
123087123085

123088-
let (typedtree, coercion, finalenv, current_signature) =
123086+
let (typedtree, coercion, _, _) =
123089123087
ast
123090123088
|> Typemod.type_implementation_more ?check_exists:(if !Js_config.force_cmi then None else Some ()) !Location.input_name outputprefix modulename env
123091123089
|> print_if ppf Clflags.dump_typedtree
@@ -123099,7 +123097,7 @@ let after_parsing_impl ppf outputprefix ast =
123099123097
|> (fun lambda ->
123100123098
let js_program =
123101123099
print_if ppf Clflags.dump_rawlambda Printlambda.lambda (get_lambda lambda)
123102-
|> Lam_compile_main.compile outputprefix finalenv in
123100+
|> Lam_compile_main.compile outputprefix in
123103123101
if not !Js_config.cmj_only then
123104123102
Lam_compile_main.lambda_as_module
123105123103
js_program

0 commit comments

Comments
 (0)