Skip to content

Commit cd3c73f

Browse files
committed
Part1: remove ocaml style OO, prepare JS style OO
1 parent 6f3256a commit cd3c73f

19 files changed

+47
-879
lines changed

jscomp/frontend/bs_ast_invariant.ml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,20 @@ let emit_external_warnings : iterator=
130130
when !Config.syntax_kind = `rescript ->
131131
Location.raise_errorf ~loc:str_item.pstr_loc
132132
"GADT has to be recursive types, please try `type rec'"
133+
| Pstr_class _ ->
134+
Location.raise_errorf ~loc:str_item.pstr_loc
135+
"OCaml style classes are not supported"
133136
| _ -> super.structure_item self str_item
134137
);
135138
expr = (fun self a ->
136139
match a.pexp_desc with
137140
| Pexp_constant(const) -> check_constant a.pexp_loc `expr const
138-
| _ -> super.expr self a
141+
| Pexp_object _
142+
| Pexp_new _ ->
143+
Location.raise_errorf ~loc:a.pexp_loc
144+
"OCaml style objects are not supported"
145+
(* | Pexp_send *)
146+
| _ -> super.expr self a
139147
);
140148
label_declaration = (fun self lbl ->
141149

jscomp/test/build.ninja

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,9 @@ o test/caml_format_test.cmi test/caml_format_test.cmj : cc test/caml_format_test
111111
o test/caml_sys_poly_fill_test.cmi test/caml_sys_poly_fill_test.cmj : cc test/caml_sys_poly_fill_test.ml | test/mt.cmj $stdlib
112112
o test/chain_code_test.cmi test/chain_code_test.cmj : cc test/chain_code_test.ml | test/mt.cmj $stdlib
113113
o test/chn_test.cmi test/chn_test.cmj : cc test/chn_test.ml | test/mt.cmj $stdlib
114-
o test/class3_test.cmi test/class3_test.cmj : cc test/class3_test.ml | test/mt.cmj $stdlib
115-
o test/class4_test.cmi test/class4_test.cmj : cc test/class4_test.ml | test/mt.cmj $stdlib
116-
o test/class5_test.cmi test/class5_test.cmj : cc test/class5_test.ml | test/mt.cmj $stdlib
117-
o test/class6_test.cmi test/class6_test.cmj : cc test/class6_test.ml | test/mt.cmj $stdlib
118-
o test/class7_test.cmi test/class7_test.cmj : cc test/class7_test.ml | test/mt.cmj $stdlib
119-
o test/class8_test.cmi test/class8_test.cmj : cc test/class8_test.ml | test/mt.cmj $stdlib
120-
o test/class_fib_open_recursion_test.cmi test/class_fib_open_recursion_test.cmj : cc test/class_fib_open_recursion_test.ml | test/mt.cmj $stdlib
121114
o test/class_repr.cmi test/class_repr.cmj : cc test/class_repr.ml | $stdlib
122115
o test/class_setter_getter.cmj : cc_cmi test/class_setter_getter.ml | test/class_setter_getter.cmi $stdlib
123116
o test/class_setter_getter.cmi : cc test/class_setter_getter.mli | $stdlib
124-
o test/class_test.cmi test/class_test.cmj : cc test/class_test.ml | test/mt.cmj $stdlib
125117
o test/class_type_ffi_test.cmi test/class_type_ffi_test.cmj : cc test/class_type_ffi_test.ml | $stdlib
126118
o test/compare_test.cmi test/compare_test.cmj : cc test/compare_test.ml | $stdlib
127119
o test/complete_parmatch_test.cmi test/complete_parmatch_test.cmj : cc test/complete_parmatch_test.ml | $stdlib
@@ -241,7 +233,6 @@ o test/gpr_1170.cmi test/gpr_1170.cmj : cc test/gpr_1170.ml | $stdlib
241233
o test/gpr_1240_missing_unbox.cmi test/gpr_1240_missing_unbox.cmj : cc test/gpr_1240_missing_unbox.ml | $stdlib
242234
o test/gpr_1245_test.cmi test/gpr_1245_test.cmj : cc test/gpr_1245_test.ml | $stdlib
243235
o test/gpr_1268.cmi test/gpr_1268.cmj : cc test/gpr_1268.ml | $stdlib
244-
o test/gpr_1285_test.cmi test/gpr_1285_test.cmj : cc test/gpr_1285_test.ml | test/mt.cmj $stdlib
245236
o test/gpr_1409_test.cmi test/gpr_1409_test.cmj : cc test/gpr_1409_test.ml | test/mt.cmj test/string_set.cmj $stdlib
246237
o test/gpr_1423_app_test.cmi test/gpr_1423_app_test.cmj : cc test/gpr_1423_app_test.ml | test/gpr_1423_nav.cmj test/mt.cmj $stdlib
247238
o test/gpr_1423_nav.cmi test/gpr_1423_nav.cmj : cc test/gpr_1423_nav.ml | $stdlib
@@ -269,7 +260,6 @@ o test/gpr_1822_test.cmi test/gpr_1822_test.cmj : cc test/gpr_1822_test.ml | tes
269260
o test/gpr_1891_test.cmi test/gpr_1891_test.cmj : cc test/gpr_1891_test.ml | $stdlib
270261
o test/gpr_1943_test.cmi test/gpr_1943_test.cmj : cc test/gpr_1943_test.ml | test/mt.cmj $stdlib
271262
o test/gpr_1946_test.cmi test/gpr_1946_test.cmj : cc test/gpr_1946_test.ml | test/mt.cmj $stdlib
272-
o test/gpr_2250_test.cmi test/gpr_2250_test.cmj : cc test/gpr_2250_test.ml | test/mt.cmj $stdlib
273263
o test/gpr_2316_test.cmi test/gpr_2316_test.cmj : cc test/gpr_2316_test.ml | test/mt.cmj $stdlib
274264
o test/gpr_2352_test.cmi test/gpr_2352_test.cmj : cc test/gpr_2352_test.ml | $stdlib
275265
o test/gpr_2413_test.cmi test/gpr_2413_test.cmj : cc test/gpr_2413_test.ml | $stdlib
@@ -474,7 +464,6 @@ o test/obj_literal_ppx.cmi test/obj_literal_ppx.cmj : cc test/obj_literal_ppx.ml
474464
o test/obj_literal_ppx_test.cmi test/obj_literal_ppx_test.cmj : cc test/obj_literal_ppx_test.ml | $stdlib
475465
o test/obj_magic_test.cmi test/obj_magic_test.cmj : cc test/obj_magic_test.ml | test/mt.cmj $stdlib
476466
o test/obj_repr_test.cmi test/obj_repr_test.cmj : cc test/obj_repr_test.ml | $stdlib
477-
o test/obj_test.cmi test/obj_test.cmj : cc test/obj_test.ml | test/mt.cmj $stdlib
478467
o test/obj_type_test.cmi test/obj_type_test.cmj : cc test/obj_type_test.ml | $stdlib
479468
o test/ocaml_parsetree_test.cmj : cc_cmi test/ocaml_parsetree_test.ml | test/nativeint.cmj test/ocaml_parsetree_test.cmi $stdlib
480469
o test/ocaml_parsetree_test.cmi : cc test/ocaml_parsetree_test.mli | $stdlib
@@ -486,8 +475,6 @@ o test/ocaml_typedtree_test.cmi : cc test/ocaml_typedtree_test.mli | $stdlib
486475
o test/of_string_test.cmi test/of_string_test.cmj : cc test/of_string_test.ml | test/mt.cmj $stdlib
487476
o test/offset.cmi test/offset.cmj : cc test/offset.ml | $stdlib
488477
o test/oo_js_test_date.cmi test/oo_js_test_date.cmj : cc test/oo_js_test_date.ml | test/mt.cmj $stdlib
489-
o test/opr_3576_test.cmi test/opr_3576_test.cmj : cc test/opr_3576_test.ml | test/mt.cmj $stdlib
490-
o test/opr_4560_test.cmi test/opr_4560_test.cmj : cc test/opr_4560_test.ml | test/mt.cmj $stdlib
491478
o test/option_repr_test.cmi test/option_repr_test.cmj : cc test/option_repr_test.ml | test/mt.cmj $stdlib
492479
o test/optional_ffi_test.cmi test/optional_ffi_test.cmj : cc test/optional_ffi_test.ml | test/mt.cmj $stdlib
493480
o test/optional_regression_test.cmi test/optional_regression_test.cmj : cc test/optional_regression_test.ml | test/mt.cmj $stdlib

jscomp/test/class3_test.ml

Lines changed: 0 additions & 197 deletions
This file was deleted.

jscomp/test/class4_test.ml

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)