Skip to content

Commit 66bf742

Browse files
committed
remove legacy code
1 parent 2287445 commit 66bf742

7 files changed

+13
-85
lines changed

jscomp/core/js_block_runtime.ml

-10
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,15 @@ let tag_is_zero (tag : J.expression) =
3434
match tag_info with
3535
| Blk_poly_var _
3636
| Blk_constructor _ -> true
37-
#if OCAML_VERSION =~ ">4.03.0" then
3837
| Blk_record_inlined _ -> true
39-
#end
4038
| Blk_record _
4139
| Blk_module_export
4240
| Blk_module _ -> false
4341
| Blk_tuple
4442
| Blk_extension
4543
| Blk_class
4644
| Blk_array
47-
#if OCAML_VERSION =~ ">4.03.0" then
4845
| Blk_record_ext _ -> false
49-
#end
5046
| Blk_extension_slot -> false
5147
| Blk_na _ -> not (tag_is_zero tag )
5248

@@ -60,18 +56,12 @@ let needBlockRuntime (tag : J.expression) (tag_info : J.tag_info) =
6056
| Blk_extension
6157
| Blk_class
6258
| Blk_array -> false
63-
#if OCAML_VERSION =~ ">4.03.0" then
6459
| Blk_record_inlined (_,_,1)
65-
#end
6660
| Blk_constructor (_, 1)
6761
| Blk_na _ -> not (tag_is_zero tag)
68-
#if OCAML_VERSION =~ ">4.03.0" then
6962
| Blk_record_inlined _
70-
#end
7163
| Blk_constructor _ -> true
72-
#if OCAML_VERSION =~ ">4.03.0" then
7364
| Blk_record_ext _
74-
#end
7565
| Blk_extension_slot -> false
7666
(* converted to [Pcreate_extension] in the beginning*)
7767

jscomp/core/js_dump.ml

+4-7
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2020
*)
2121
(* Authors: Jérôme Vouillon, Hongbo Zhang *)
22-
#if OCAML_VERSION =~ ">4.03.0" then
23-
[@@@ocaml.warning "-57"] (* turn off such warning temporarily*)
24-
#end
22+
23+
[@@@ocaml.warning "-57"] (* FIXME: turn off such warning temporarily*)
24+
2525
(*
2626
http://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi
2727
ASI catch up
@@ -874,16 +874,13 @@ and expression_desc cxt ~(level:int) f x : cxt =
874874
end
875875

876876

877-
#if OCAML_VERSION =~ ">4.03.0" then
877+
878878
| Blk_record_inlined _ (* TODO: No support for debug mode yet *)
879-
#end
880879
| Blk_tuple
881880
| Blk_extension
882881
| Blk_class
883882
| Blk_array
884-
#if OCAML_VERSION =~ ">4.03.0" then
885883
| Blk_record_ext _
886-
#end
887884
| Blk_extension_slot
888885
| Blk_na _
889886
->

jscomp/core/js_exp_make.ml

-2
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,13 @@ let make_block ?comment
186186
| _ -> comment in
187187
let es =
188188
match tag_info with
189-
#if OCAML_VERSION =~ ">4.03.0" then
190189
| Blk_record_inlined (des, _,_)
191190
->
192191
Ext_list.mapi es (fun i e -> merge_outer_comment des.(i) e)
193192
| Blk_record_ext des
194193
->
195194
Ext_list.mapi es (fun i e ->
196195
if i <> 0 then merge_outer_comment des.(i-1) e else e)
197-
#end
198196
(* TODO: may overriden its previous comments *)
199197
| Blk_record _
200198
| Blk_module _

jscomp/core/js_implementation.ml

+2-10
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ let after_parsing_sig ppf outputprefix ast =
7575
Env.set_unit_name modulename;
7676

7777
let tsg = Typemod.type_interface
78-
#if OCAML_VERSION =~ ">4.03.0" then
7978
!Location.input_name
80-
#end
8179
initial_env ast in
8280
if !Clflags.dump_typedtree then fprintf ppf "%a@." Printtyped.interface tsg;
8381
let sg = tsg.sig_type in
@@ -89,14 +87,11 @@ let after_parsing_sig ppf outputprefix ast =
8987
Typecore.force_delayed_checks ();
9088
Warnings.check_fatal ();
9189
if not !Clflags.print_types then begin
92-
#if OCAML_VERSION =~ ">4.03.0" then
90+
9391
let deprecated = Builtin_attributes.deprecated_of_sig ast in
9492
let sg =
9593
Env.save_signature ~deprecated sg modulename (outputprefix ^ ".cmi")
9694
in
97-
#else
98-
let sg = Env.save_signature ?check_exists:(if !Js_config.force_cmi then None else Some ()) sg modulename (outputprefix ^ ".cmi") in
99-
#end
10095
Typemod.save_signature modulename tsg outputprefix !Location.input_name
10196
initial_env sg ;
10297
process_with_gentype (outputprefix ^ ".cmti");
@@ -122,11 +117,8 @@ let interface_mliast ppf fname outputprefix =
122117

123118

124119
let get_lambda = fun
125-
#if OCAML_VERSION =~ ">4.03.0" then
126120
{Lambda.code = lambda}
127-
#else
128-
lambda
129-
#end -> lambda
121+
-> lambda
130122

131123

132124
let all_module_alias (ast : Parsetree.structure)=

lib/4.06.1/unstable/js_compiler.ml

+2-17
Original file line numberDiff line numberDiff line change
@@ -93091,19 +93091,15 @@ let tag_is_zero (tag : J.expression) =
9309193091
match tag_info with
9309293092
| Blk_poly_var _
9309393093
| Blk_constructor _ -> true
93094-
9309593094
| Blk_record_inlined _ -> true
93096-
9309793095
| Blk_record _
9309893096
| Blk_module_export
9309993097
| Blk_module _ -> false
9310093098
| Blk_tuple
9310193099
| Blk_extension
9310293100
| Blk_class
9310393101
| Blk_array
93104-
9310593102
| Blk_record_ext _ -> false
93106-
9310793103
| Blk_extension_slot -> false
9310893104
| Blk_na _ -> not (tag_is_zero tag )
9310993105

@@ -93117,18 +93113,12 @@ let needBlockRuntime (tag : J.expression) (tag_info : J.tag_info) =
9311793113
| Blk_extension
9311893114
| Blk_class
9311993115
| Blk_array -> false
93120-
9312193116
| Blk_record_inlined (_,_,1)
93122-
9312393117
| Blk_constructor (_, 1)
9312493118
| Blk_na _ -> not (tag_is_zero tag)
93125-
9312693119
| Blk_record_inlined _
93127-
9312893120
| Blk_constructor _ -> true
93129-
9313093121
| Blk_record_ext _
93131-
9313293122
| Blk_extension_slot -> false
9313393123
(* converted to [Pcreate_extension] in the beginning*)
9313493124

@@ -95294,15 +95284,13 @@ let make_block ?comment
9529495284
| _ -> comment in
9529595285
let es =
9529695286
match tag_info with
95297-
9529895287
| Blk_record_inlined (des, _,_)
9529995288
->
9530095289
Ext_list.mapi es (fun i e -> merge_outer_comment des.(i) e)
9530195290
| Blk_record_ext des
9530295291
->
9530395292
Ext_list.mapi es (fun i e ->
9530495293
if i <> 0 then merge_outer_comment des.(i-1) e else e)
95305-
9530695294
(* TODO: may overriden its previous comments *)
9530795295
| Blk_record _
9530895296
| Blk_module _
@@ -97300,7 +97288,7 @@ end = struct
9730097288
*)
9730197289
(* Authors: Jérôme Vouillon, Hongbo Zhang *)
9730297290

97303-
[@@@ocaml.warning "-57"] (* turn off such warning temporarily*)
97291+
[@@@ocaml.warning "-57"] (* FIXME: turn off such warning temporarily*)
9730497292

9730597293
(*
9730697294
http://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi
@@ -98154,16 +98142,13 @@ and expression_desc cxt ~(level:int) f x : cxt =
9815498142
end
9815598143

9815698144

98157-
98158-
| Blk_record_inlined _ (* TODO: No support for debug mode yet *)
9815998145

98146+
| Blk_record_inlined _ (* TODO: No support for debug mode yet *)
9816098147
| Blk_tuple
9816198148
| Blk_extension
9816298149
| Blk_class
9816398150
| Blk_array
98164-
9816598151
| Blk_record_ext _
98166-
9816798152
| Blk_extension_slot
9816898153
| Blk_na _
9816998154
->

lib/4.06.1/unstable/js_refmt_compiler.ml

+2-17
Original file line numberDiff line numberDiff line change
@@ -93091,19 +93091,15 @@ let tag_is_zero (tag : J.expression) =
9309193091
match tag_info with
9309293092
| Blk_poly_var _
9309393093
| Blk_constructor _ -> true
93094-
9309593094
| Blk_record_inlined _ -> true
93096-
9309793095
| Blk_record _
9309893096
| Blk_module_export
9309993097
| Blk_module _ -> false
9310093098
| Blk_tuple
9310193099
| Blk_extension
9310293100
| Blk_class
9310393101
| Blk_array
93104-
9310593102
| Blk_record_ext _ -> false
93106-
9310793103
| Blk_extension_slot -> false
9310893104
| Blk_na _ -> not (tag_is_zero tag )
9310993105

@@ -93117,18 +93113,12 @@ let needBlockRuntime (tag : J.expression) (tag_info : J.tag_info) =
9311793113
| Blk_extension
9311893114
| Blk_class
9311993115
| Blk_array -> false
93120-
9312193116
| Blk_record_inlined (_,_,1)
93122-
9312393117
| Blk_constructor (_, 1)
9312493118
| Blk_na _ -> not (tag_is_zero tag)
93125-
9312693119
| Blk_record_inlined _
93127-
9312893120
| Blk_constructor _ -> true
93129-
9313093121
| Blk_record_ext _
93131-
9313293122
| Blk_extension_slot -> false
9313393123
(* converted to [Pcreate_extension] in the beginning*)
9313493124

@@ -95294,15 +95284,13 @@ let make_block ?comment
9529495284
| _ -> comment in
9529595285
let es =
9529695286
match tag_info with
95297-
9529895287
| Blk_record_inlined (des, _,_)
9529995288
->
9530095289
Ext_list.mapi es (fun i e -> merge_outer_comment des.(i) e)
9530195290
| Blk_record_ext des
9530295291
->
9530395292
Ext_list.mapi es (fun i e ->
9530495293
if i <> 0 then merge_outer_comment des.(i-1) e else e)
95305-
9530695294
(* TODO: may overriden its previous comments *)
9530795295
| Blk_record _
9530895296
| Blk_module _
@@ -97300,7 +97288,7 @@ end = struct
9730097288
*)
9730197289
(* Authors: Jérôme Vouillon, Hongbo Zhang *)
9730297290

97303-
[@@@ocaml.warning "-57"] (* turn off such warning temporarily*)
97291+
[@@@ocaml.warning "-57"] (* FIXME: turn off such warning temporarily*)
9730497292

9730597293
(*
9730697294
http://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi
@@ -98154,16 +98142,13 @@ and expression_desc cxt ~(level:int) f x : cxt =
9815498142
end
9815598143

9815698144

98157-
98158-
| Blk_record_inlined _ (* TODO: No support for debug mode yet *)
9815998145

98146+
| Blk_record_inlined _ (* TODO: No support for debug mode yet *)
9816098147
| Blk_tuple
9816198148
| Blk_extension
9816298149
| Blk_class
9816398150
| Blk_array
98164-
9816598151
| Blk_record_ext _
98166-
9816798152
| Blk_extension_slot
9816898153
| Blk_na _
9816998154
->

lib/4.06.1/whole_compiler.ml

+3-22
Original file line numberDiff line numberDiff line change
@@ -86287,15 +86287,13 @@ let make_block ?comment
8628786287
| _ -> comment in
8628886288
let es =
8628986289
match tag_info with
86290-
8629186290
| Blk_record_inlined (des, _,_)
8629286291
->
8629386292
Ext_list.mapi es (fun i e -> merge_outer_comment des.(i) e)
8629486293
| Blk_record_ext des
8629586294
->
8629686295
Ext_list.mapi es (fun i e ->
8629786296
if i <> 0 then merge_outer_comment des.(i-1) e else e)
86298-
8629986297
(* TODO: may overriden its previous comments *)
8630086298
| Blk_record _
8630186299
| Blk_module _
@@ -99417,19 +99415,15 @@ let tag_is_zero (tag : J.expression) =
9941799415
match tag_info with
9941899416
| Blk_poly_var _
9941999417
| Blk_constructor _ -> true
99420-
9942199418
| Blk_record_inlined _ -> true
99422-
9942399419
| Blk_record _
9942499420
| Blk_module_export
9942599421
| Blk_module _ -> false
9942699422
| Blk_tuple
9942799423
| Blk_extension
9942899424
| Blk_class
9942999425
| Blk_array
99430-
9943199426
| Blk_record_ext _ -> false
99432-
9943399427
| Blk_extension_slot -> false
9943499428
| Blk_na _ -> not (tag_is_zero tag )
9943599429

@@ -99443,18 +99437,12 @@ let needBlockRuntime (tag : J.expression) (tag_info : J.tag_info) =
9944399437
| Blk_extension
9944499438
| Blk_class
9944599439
| Blk_array -> false
99446-
9944799440
| Blk_record_inlined (_,_,1)
99448-
9944999441
| Blk_constructor (_, 1)
9945099442
| Blk_na _ -> not (tag_is_zero tag)
99451-
9945299443
| Blk_record_inlined _
99453-
9945499444
| Blk_constructor _ -> true
99455-
9945699445
| Blk_record_ext _
99457-
9945899446
| Blk_extension_slot -> false
9945999447
(* converted to [Pcreate_extension] in the beginning*)
9946099448

@@ -100088,7 +100076,7 @@ end = struct
100088100076
*)
100089100077
(* Authors: Jérôme Vouillon, Hongbo Zhang *)
100090100078

100091-
[@@@ocaml.warning "-57"] (* turn off such warning temporarily*)
100079+
[@@@ocaml.warning "-57"] (* FIXME: turn off such warning temporarily*)
100092100080

100093100081
(*
100094100082
http://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi
@@ -100942,16 +100930,13 @@ and expression_desc cxt ~(level:int) f x : cxt =
100942100930
end
100943100931

100944100932

100945-
100946-
| Blk_record_inlined _ (* TODO: No support for debug mode yet *)
100947100933

100934+
| Blk_record_inlined _ (* TODO: No support for debug mode yet *)
100948100935
| Blk_tuple
100949100936
| Blk_extension
100950100937
| Blk_class
100951100938
| Blk_array
100952-
100953100939
| Blk_record_ext _
100954-
100955100940
| Blk_extension_slot
100956100941
| Blk_na _
100957100942
->
@@ -136800,9 +136785,7 @@ let after_parsing_sig ppf outputprefix ast =
136800136785
Env.set_unit_name modulename;
136801136786

136802136787
let tsg = Typemod.type_interface
136803-
136804136788
!Location.input_name
136805-
136806136789
initial_env ast in
136807136790
if !Clflags.dump_typedtree then fprintf ppf "%a@." Printtyped.interface tsg;
136808136791
let sg = tsg.sig_type in
@@ -136819,7 +136802,6 @@ let after_parsing_sig ppf outputprefix ast =
136819136802
let sg =
136820136803
Env.save_signature ~deprecated sg modulename (outputprefix ^ ".cmi")
136821136804
in
136822-
136823136805
Typemod.save_signature modulename tsg outputprefix !Location.input_name
136824136806
initial_env sg ;
136825136807
process_with_gentype (outputprefix ^ ".cmti");
@@ -136845,9 +136827,8 @@ let interface_mliast ppf fname outputprefix =
136845136827

136846136828

136847136829
let get_lambda = fun
136848-
136849136830
{Lambda.code = lambda}
136850-
-> lambda
136831+
-> lambda
136851136832

136852136833

136853136834
let all_module_alias (ast : Parsetree.structure)=

0 commit comments

Comments
 (0)