From 6688b31ee21462869b76c2ae87f6fff940b8e609 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Wed, 1 Jun 2016 15:03:36 -0400 Subject: [PATCH 1/5] [feature] prepare global default configuration --- jscomp/syntax/ast_payload.ml | 28 +++++++++++ jscomp/syntax/ast_payload.mli | 5 ++ jscomp/syntax/ppx_entry.ml | 90 ++++++++++++++++++++++++++--------- jscomp/test/.depend | 9 ++++ jscomp/test/config1_test.ml | 9 ++++ jscomp/test/config2_test.ml | 25 ++++++++++ jscomp/test/config2_test.mli | 19 ++++++++ jscomp/test/test.mllib | 6 ++- lib/js/test/config1_test.js | 8 ++++ lib/js/test/config2_test.js | 10 ++++ 10 files changed, 185 insertions(+), 24 deletions(-) create mode 100644 jscomp/test/config1_test.ml create mode 100644 jscomp/test/config2_test.ml create mode 100644 jscomp/test/config2_test.mli create mode 100644 lib/js/test/config1_test.js create mode 100644 lib/js/test/config2_test.js diff --git a/jscomp/syntax/ast_payload.ml b/jscomp/syntax/ast_payload.ml index a25d2995fe4..a384885bb0e 100644 --- a/jscomp/syntax/ast_payload.ml +++ b/jscomp/syntax/ast_payload.ml @@ -53,6 +53,25 @@ let as_empty_structure (x : t ) = | PStr ([]) -> true | PTyp _ | PPat _ | PStr (_ :: _ ) -> false + +let as_record_and_process + loc + ( x : t ) (action : Longident.t Asttypes.loc * Parsetree.expression -> unit ): unit= + match x with + | PStr [ {pstr_desc = Pstr_eval + ({pexp_desc = Pexp_record (label_exprs, with_obj) ; pexp_loc = loc}, _); + _ + }] + -> + begin match with_obj with + | None -> + List.iter action label_exprs + | Some _ -> + Location.raise_errorf ~loc "with is not supported" + end + | _ -> + Location.raise_errorf ~loc "this is not a valid record config" + let is_string_or_strings (x : t) : [ `None | `Single of string | `Some of string list ] = let module M = struct exception Not_str end in @@ -83,3 +102,12 @@ let is_string_or_strings (x : t) : _},_); _}] -> `Single name | _ -> `None + +let assert_bool_lit (e : Parsetree.expression) = + match e.pexp_desc with + | Pexp_construct ({txt = Lident "true" }, None) + -> true + | Pexp_construct ({txt = Lident "false" }, None) + -> false + | _ -> + Location.raise_errorf ~loc:e.pexp_loc "expect `true` or `false` in this field" diff --git a/jscomp/syntax/ast_payload.mli b/jscomp/syntax/ast_payload.mli index aed9b7cebda..92f87d063d2 100644 --- a/jscomp/syntax/ast_payload.mli +++ b/jscomp/syntax/ast_payload.mli @@ -34,3 +34,8 @@ val as_string_exp : t -> Parsetree.expression option val as_empty_structure : t -> bool val is_string_or_strings : t -> [ `None | `Single of string | `Some of string list ] +val as_record_and_process : + Location.t -> + t -> (Longident.t Asttypes.loc * Parsetree.expression -> unit) -> unit + +val assert_bool_lit : Parsetree.expression -> bool diff --git a/jscomp/syntax/ppx_entry.ml b/jscomp/syntax/ppx_entry.ml index 91b8448d0ee..a1ba6f11d2d 100644 --- a/jscomp/syntax/ppx_entry.ml +++ b/jscomp/syntax/ppx_entry.ml @@ -76,6 +76,12 @@ let arrow = Ast_helper.Typ.arrow let record_as_js_object = ref None (* otherwise has an attribute *) let obj_type_as_js_obj_type = ref false +let uncurry_type = ref false +let obj_type_auto_uncurry = ref false + +let lift_js_type ~loc x = Typ.constr ~loc {txt = js_obj_type_id (); loc} [x] +let lift_curry_type ~loc x = Typ.constr ~loc {txt = curry_type_id (); loc} [x] + let handle_record_as_js_object loc attr @@ -96,10 +102,9 @@ let handle_record_as_js_object Typ.var ~loc ("a" ^ string_of_int i))) in let result_type = - Typ.constr ~loc {txt = js_obj_type_id () ; loc} - [ - Typ.object_ ~loc (List.map2 (fun x y -> x ,[], y) labels tyvars) Closed - ] + lift_js_type ~loc + @@ Typ.object_ ~loc (List.map2 (fun x y -> x ,[], y) labels tyvars) Closed + in List.fold_right2 (fun label tyvar acc -> arrow ~loc label tyvar acc) labels tyvars result_type @@ -126,8 +131,7 @@ let gen_fn_run loc arity args : Parsetree.expression_desc = Parsetree.Ptyp_tuple tyvars in let uncurry_fn = - Typ.constr ~loc {txt = curry_type_id (); loc} - [ Typ.mk ~loc tuple_type_desc] in + lift_curry_type ~loc @@ Typ.mk ~loc tuple_type_desc in (** could be optimized *) let pval_type = Ext_list.reduce_from_right (fun a b -> arrow ~loc "" a b) (uncurry_fn :: tyvars) in @@ -153,8 +157,7 @@ let gen_fn_mk loc arity args : Parsetree.expression_desc = Parsetree.Ptyp_tuple tyvars in let uncurry_fn = - Typ.constr ~loc {txt = curry_type_id (); loc} - [Typ.mk ~loc tuple_type_desc] + lift_curry_type ~loc @@ Typ.mk ~loc tuple_type_desc in let arrow = arrow ~loc "" in (** could be optimized *) @@ -192,10 +195,10 @@ let uncurry_fn_type loc ty attrs | v -> Typ.tuple ~loc ~attrs [v ; body] in - Typ.constr ~loc {txt = curry_type_id () ; loc} [ fn_type] + lift_curry_type ~loc fn_type + -let uncurry_type = ref false (* Attributes are very hard to attribute @@ -249,12 +252,9 @@ let handle_typ ) methods in if !obj_type_as_js_obj_type then - {ptyp_desc = - Ptyp_constr ({ txt = js_obj_type_id () ; loc}, - [{ ty with ptyp_desc = Ptyp_object(methods, closed_flag); - ptyp_attributes }]); - ptyp_attributes = []; - ptyp_loc = loc } + lift_js_type ~loc { ty with ptyp_desc = Ptyp_object(methods, closed_flag); + ptyp_attributes } + else {ty with ptyp_desc = Ptyp_object (methods, closed_flag)} | fact1 , fact2, ptyp_attributes -> @@ -374,10 +374,7 @@ let handle_obj_property loc obj name e ~pval_prim:"js_unsafe_downgrade" ~pval_type:( Ast_comb.arrow_no_label ~loc - (Typ.constr ~loc - {txt = js_obj_type_id () ; loc} - [var]) - var) + (lift_js_type ~loc var) var) ~local_module_name:"Tmp" ~local_fun_name:"cast" ["", obj] in @@ -429,7 +426,7 @@ let handle_obj_method loc (obj : Parsetree.expression) let down = Ast_comb.create_local_external loc ~pval_prim:"js_unsafe_downgrade" ~pval_type:(Ast_comb.arrow_no_label ~loc - (Typ.constr ~loc {txt = js_obj_type_id () ; loc} [var]) + (lift_js_type ~loc var) var ) ~local_module_name:"Tmp" ~local_fun_name:"cast" ["", obj] in @@ -635,11 +632,58 @@ let rec unsafe_mapper : Ast_mapper.mapper = end ) } + + +let common_actions_table : + (string * (Parsetree.expression -> unit)) list = + [ "obj_type_auto_uncurry", + (fun e -> + obj_type_as_js_obj_type := Ast_payload.assert_bool_lit e + ) + ] + + +let structural_config_table = + String_map.of_list common_actions_table + +let signature_config_table = + String_map.of_list common_actions_table + + +let make_call_back table ((x : Longident.t Asttypes.loc) , y) = + match x with + | {txt = Lident name; loc } -> + begin match String_map.find name table with + | fn -> fn y + | exception _ -> Location.raise_errorf ~loc "%s is not supported" name + end + | {loc} -> + Location.raise_errorf ~loc "invalid label for config" + let rewrite_signature : (Parsetree.signature -> Parsetree.signature) ref = ref (fun x -> - unsafe_mapper.signature unsafe_mapper x + match (x : Parsetree.signature) with + | {psig_desc = Psig_attribute ({txt = "bs.config"; loc}, payload); _} :: rest + -> + begin + Ast_payload.as_record_and_process loc payload + (make_call_back signature_config_table) ; + unsafe_mapper.signature unsafe_mapper rest + end + | _ -> + unsafe_mapper.signature unsafe_mapper x ) let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref = - ref (fun x -> unsafe_mapper.structure unsafe_mapper x ) + ref (fun (x : Parsetree.structure) -> + match x with + | {pstr_desc = Pstr_attribute ({txt = "bs.config"; loc}, payload); _} :: rest + -> + begin + Ast_payload.as_record_and_process loc payload + (make_call_back structural_config_table) ; + unsafe_mapper.structure unsafe_mapper rest + end + | _ -> + unsafe_mapper.structure unsafe_mapper x ) diff --git a/jscomp/test/.depend b/jscomp/test/.depend index 4acc9bfce74..41f764c8b96 100644 --- a/jscomp/test/.depend +++ b/jscomp/test/.depend @@ -3,6 +3,7 @@ abstract_type.cmi : ari_regress_test.cmi : array_test.cmi : basic_module_test.cmi : +config2_test.cmi : ../runtime/js.cmj const_block_test.cmi : demo_int_map.cmi : ext_pervasives.cmi : ../stdlib/int32.cmi ../stdlib/format.cmi @@ -107,6 +108,10 @@ complex_test.cmj : mt.cmi ../stdlib/complex.cmi complex_test.cmx : mt.cmx ../stdlib/complex.cmx complex_while_loop.cmj : complex_while_loop.cmx : +config1_test.cmj : +config1_test.cmx : +config2_test.cmj : ../runtime/js.cmj config2_test.cmi +config2_test.cmx : ../runtime/js.cmx config2_test.cmi const_block_test.cmj : mt.cmi ../stdlib/array.cmi const_block_test.cmi const_block_test.cmx : mt.cmx ../stdlib/array.cmx const_block_test.cmi const_defs.cmj : @@ -761,6 +766,10 @@ complex_test.cmo : mt.cmi ../stdlib/complex.cmi complex_test.cmj : mt.cmj ../stdlib/complex.cmj complex_while_loop.cmo : complex_while_loop.cmj : +config1_test.cmo : +config1_test.cmj : +config2_test.cmo : ../runtime/js.cmo config2_test.cmi +config2_test.cmj : ../runtime/js.cmj config2_test.cmi const_block_test.cmo : mt.cmi ../stdlib/array.cmi const_block_test.cmi const_block_test.cmj : mt.cmj ../stdlib/array.cmj const_block_test.cmi const_defs.cmo : diff --git a/jscomp/test/config1_test.ml b/jscomp/test/config1_test.ml new file mode 100644 index 00000000000..2d83ffaafb9 --- /dev/null +++ b/jscomp/test/config1_test.ml @@ -0,0 +1,9 @@ + +;;[@@@bs.config{ + obj_type_auto_uncurry = true; + (* non_export = true; *) +}] +;; + + +let a = 3 diff --git a/jscomp/test/config2_test.ml b/jscomp/test/config2_test.ml new file mode 100644 index 00000000000..7e4593190e5 --- /dev/null +++ b/jscomp/test/config2_test.ml @@ -0,0 +1,25 @@ +[@@@bs.config{ + obj_type_auto_uncurry = true; + (* non_export = true; *) +}] + + + +class type v = object [@uncurry] + method hi : int * int -> int +end + + +type vv = + < + hey : int * int -> int + > [@bs.obj] [@uncurry] + + + +let h ( x : v Js.t)= + x##hi (1,2) + + +let test_vv (h : vv) = + h##hey(1,2) diff --git a/jscomp/test/config2_test.mli b/jscomp/test/config2_test.mli new file mode 100644 index 00000000000..8571ca6ba26 --- /dev/null +++ b/jscomp/test/config2_test.mli @@ -0,0 +1,19 @@ +[@@@bs.config{ + obj_type_auto_uncurry = true; + (* non_export = true; *) +}] + + +class type v = object [@uncurry] + method hi : int * int -> int +end + + +type vv = + < + hey : int * int -> int + > [@bs.obj] + +val h : v Js.t -> int + +val test_vv : vv -> int diff --git a/jscomp/test/test.mllib b/jscomp/test/test.mllib index c0b85201795..a75e4d73cca 100644 --- a/jscomp/test/test.mllib +++ b/jscomp/test/test.mllib @@ -317,7 +317,11 @@ nested_obj_literal method_name_test format_test + # sig # delaunay # rand -# builder \ No newline at end of file +# builder + +config1_test +config2_test \ No newline at end of file diff --git a/lib/js/test/config1_test.js b/lib/js/test/config1_test.js new file mode 100644 index 00000000000..6d595e3f79f --- /dev/null +++ b/lib/js/test/config1_test.js @@ -0,0 +1,8 @@ +// GENERATED CODE BY BUCKLESCRIPT VERSION 0.5.0 , PLEASE EDIT WITH CARE +'use strict'; + + +var a = 3; + +exports.a = a; +/* No side effect */ diff --git a/lib/js/test/config2_test.js b/lib/js/test/config2_test.js new file mode 100644 index 00000000000..cf4cfd17209 --- /dev/null +++ b/lib/js/test/config2_test.js @@ -0,0 +1,10 @@ +// GENERATED CODE BY BUCKLESCRIPT VERSION 0.5.0 , PLEASE EDIT WITH CARE +'use strict'; + + +function h(x) { + return x.hi(1, 2); +} + +exports.h = h; +/* No side effect */ From 2ced55bb1097cc3e978f863d72e58b5bc7a8c835 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Wed, 1 Jun 2016 15:42:42 -0400 Subject: [PATCH 2/5] [fix] now object_auto_curry works --- jscomp/syntax/ppx_entry.ml | 37 ++++++++++++++++++++---------------- jscomp/test/config2_test.ml | 19 ++++++++++++++---- jscomp/test/config2_test.mli | 19 +++++++++++------- lib/js/test/config2_test.js | 11 ++++++++--- 4 files changed, 56 insertions(+), 30 deletions(-) diff --git a/jscomp/syntax/ppx_entry.ml b/jscomp/syntax/ppx_entry.ml index a1ba6f11d2d..f1b1b0b8858 100644 --- a/jscomp/syntax/ppx_entry.ml +++ b/jscomp/syntax/ppx_entry.ml @@ -242,12 +242,19 @@ let handle_typ | _ -> false) ptyp_attributes with | None, None, _ -> + let check_auto_uncurry core_type = + if !obj_type_auto_uncurry then + Ext_ref.protect uncurry_type true (fun _ -> self.typ self core_type ) + else self.typ self core_type in + let methods = List.map (fun (label, ptyp_attrs, core_type ) -> match find_uncurry_attrs_and_remove ptyp_attrs with - | None, _ -> label, ptyp_attrs , self.typ self core_type + | None, _ -> + label, ptyp_attrs , check_auto_uncurry core_type | Some v, ptyp_attrs -> - label , ptyp_attrs, self.typ self + label , ptyp_attrs, + check_auto_uncurry { core_type with ptyp_attributes = v :: core_type.ptyp_attributes} ) methods in @@ -259,7 +266,7 @@ let handle_typ {ty with ptyp_desc = Ptyp_object (methods, closed_flag)} | fact1 , fact2, ptyp_attributes -> let obj_type_as_js_obj_type_cxt = fact1 <> None || !obj_type_as_js_obj_type in - let uncurry_type_cxt = fact2 <> None || !uncurry_type in + let uncurry_type_cxt = fact2 <> None || !uncurry_type || !obj_type_auto_uncurry in let methods = Ext_ref.protect2 obj_type_as_js_obj_type @@ -287,7 +294,7 @@ let handle_typ end | _ -> super.typ self ty -let handle_ctyp +let handle_class_obj_typ (super : Ast_mapper.mapper) (self : Ast_mapper.mapper) (ty : Parsetree.class_type) = @@ -301,7 +308,13 @@ let handle_ctyp Ext_ref.protect uncurry_type true begin fun () -> self.class_type self {ty with pcty_attributes = pcty_attributes'} end - | None, _ -> super.class_type self ty + | None, _ -> + if !obj_type_auto_uncurry then + Ext_ref.protect uncurry_type true begin fun () -> + super.class_type self ty + end + else + super.class_type self ty end @@ -431,15 +444,7 @@ let handle_obj_method loc (obj : Parsetree.expression) ~local_module_name:"Tmp" ~local_fun_name:"cast" ["", obj] in {e with pexp_desc = gen_fn_run loc len - (("", - {pexp_desc = - Pexp_send - ({pexp_desc = down ; - pexp_loc = loc ; - pexp_attributes = []}, - name); - pexp_loc = loc ; - pexp_attributes = [] }) :: + (("", Exp.send ~loc (Exp.mk ~loc down) name) :: List.map (fun x -> "", x) args )} (** TODO: @@ -607,7 +612,7 @@ let rec unsafe_mapper : Ast_mapper.mapper = | _ -> Ast_mapper.default_mapper.expr mapper e ); typ = (fun self typ -> handle_typ Ast_mapper.default_mapper self typ); - class_type = (fun self ctyp -> handle_ctyp Ast_mapper.default_mapper self ctyp); + class_type = (fun self ctyp -> handle_class_obj_typ Ast_mapper.default_mapper self ctyp); structure_item = (fun mapper (str : Parsetree.structure_item) -> begin match str.pstr_desc with | Pstr_extension ( ({txt = "bs.raw"; loc}, payload), _attrs) @@ -638,7 +643,7 @@ let common_actions_table : (string * (Parsetree.expression -> unit)) list = [ "obj_type_auto_uncurry", (fun e -> - obj_type_as_js_obj_type := Ast_payload.assert_bool_lit e + obj_type_auto_uncurry := Ast_payload.assert_bool_lit e ) ] diff --git a/jscomp/test/config2_test.ml b/jscomp/test/config2_test.ml index 7e4593190e5..1bf1e659310 100644 --- a/jscomp/test/config2_test.ml +++ b/jscomp/test/config2_test.ml @@ -6,20 +6,31 @@ class type v = object [@uncurry] - method hi : int * int -> int + method hey : int * int -> int end +class type v2 = object + method hey : int * int -> int +end type vv = < hey : int * int -> int > [@bs.obj] [@uncurry] +type vv2 = + < + hey : int * int -> int + > [@bs.obj] + + +let hh (x : v) : v2 = x +let hh2 ( x : vv) : vv2 = x -let h ( x : v Js.t)= - x##hi (1,2) +let test_v (x : v Js.t) = + x##hey(1,2) -let test_vv (h : vv) = +let test_vv (h : vv) = h##hey(1,2) diff --git a/jscomp/test/config2_test.mli b/jscomp/test/config2_test.mli index 8571ca6ba26..134e52509a4 100644 --- a/jscomp/test/config2_test.mli +++ b/jscomp/test/config2_test.mli @@ -1,19 +1,24 @@ -[@@@bs.config{ - obj_type_auto_uncurry = true; - (* non_export = true; *) -}] +[@@@bs.config {obj_type_auto_uncurry = true } ] class type v = object [@uncurry] - method hi : int * int -> int + method hey : int * int -> int end +class type v2 = object + method hey : int * int -> int +end type vv = < hey : int * int -> int - > [@bs.obj] + > [@bs.obj] [@uncurry] + +type vv2 = + < + hey : int * int -> int + > [@bs.obj] -val h : v Js.t -> int +val test_v : v Js.t -> int val test_vv : vv -> int diff --git a/lib/js/test/config2_test.js b/lib/js/test/config2_test.js index cf4cfd17209..f10f55f2e63 100644 --- a/lib/js/test/config2_test.js +++ b/lib/js/test/config2_test.js @@ -2,9 +2,14 @@ 'use strict'; -function h(x) { - return x.hi(1, 2); +function test_v(x) { + return x.hey(1, 2); } -exports.h = h; +function test_vv(h) { + return h.hey(1, 2); +} + +exports.test_v = test_v; +exports.test_vv = test_vv; /* No side effect */ From cac4f3b225fb0d45caa8dc4917cbea94ad58a79c Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Wed, 1 Jun 2016 15:45:07 -0400 Subject: [PATCH 3/5] [clean up] --- jscomp/syntax/ppx_entry.ml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/jscomp/syntax/ppx_entry.ml b/jscomp/syntax/ppx_entry.ml index f1b1b0b8858..1c7cf6de15b 100644 --- a/jscomp/syntax/ppx_entry.ml +++ b/jscomp/syntax/ppx_entry.ml @@ -166,10 +166,8 @@ let gen_fn_mk loc arity args : Parsetree.expression_desc = arrow (arrow (Ast_literal.type_unit ~loc ()) (List.hd tyvars) ) uncurry_fn else arrow (Ext_list.reduce_from_right arrow tyvars) uncurry_fn in - let local_module_name = "Tmp" in - let local_fun_name = "mk" in Ast_comb.create_local_external loc ~pval_prim ~pval_type - ~local_module_name ~local_fun_name args + args let find_uncurry_attrs_and_remove (attrs : Parsetree.attributes ) = @@ -388,9 +386,7 @@ let handle_obj_property loc obj name e ~pval_type:( Ast_comb.arrow_no_label ~loc (lift_js_type ~loc var) var) - - ~local_module_name:"Tmp" - ~local_fun_name:"cast" ["", obj] in + ["", obj] in { e with pexp_desc = Pexp_send ({pexp_desc = down ; From fff4eeb1810c9d8c7bdbc464cb7b844354d280c8 Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Wed, 1 Jun 2016 15:59:11 -0400 Subject: [PATCH 4/5] [feature] support non_export --- jscomp/syntax/ppx_entry.ml | 18 +++++++++++++++--- jscomp/test/config1_test.ml | 2 +- jscomp/test/config2_test.mli | 2 +- lib/js/test/config1_test.js | 2 -- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/jscomp/syntax/ppx_entry.ml b/jscomp/syntax/ppx_entry.ml index 1c7cf6de15b..9adc05820fb 100644 --- a/jscomp/syntax/ppx_entry.ml +++ b/jscomp/syntax/ppx_entry.ml @@ -78,7 +78,7 @@ let record_as_js_object = ref None (* otherwise has an attribute *) let obj_type_as_js_obj_type = ref false let uncurry_type = ref false let obj_type_auto_uncurry = ref false - +let non_export = ref false let lift_js_type ~loc x = Typ.constr ~loc {txt = js_obj_type_id (); loc} [x] let lift_curry_type ~loc x = Typ.constr ~loc {txt = curry_type_id (); loc} [x] @@ -645,7 +645,10 @@ let common_actions_table : let structural_config_table = - String_map.of_list common_actions_table + String_map.of_list + (( "non_export" , + (fun e -> non_export := Ast_payload.assert_bool_lit e )) + :: common_actions_table) let signature_config_table = String_map.of_list common_actions_table @@ -683,7 +686,16 @@ let rewrite_implementation : (Parsetree.structure -> Parsetree.structure) ref = begin Ast_payload.as_record_and_process loc payload (make_call_back structural_config_table) ; - unsafe_mapper.structure unsafe_mapper rest + let rest = unsafe_mapper.structure unsafe_mapper rest in + if !non_export then + [Str.include_ ~loc + (Incl.mk ~loc + (Mod.constraint_ ~loc + (Mod.structure ~loc rest ) + (Mty.signature ~loc []) + ))] + else rest + end | _ -> unsafe_mapper.structure unsafe_mapper x ) diff --git a/jscomp/test/config1_test.ml b/jscomp/test/config1_test.ml index 2d83ffaafb9..4bea4dd85b0 100644 --- a/jscomp/test/config1_test.ml +++ b/jscomp/test/config1_test.ml @@ -1,7 +1,7 @@ ;;[@@@bs.config{ obj_type_auto_uncurry = true; - (* non_export = true; *) + non_export = true; }] ;; diff --git a/jscomp/test/config2_test.mli b/jscomp/test/config2_test.mli index 134e52509a4..58ec540795d 100644 --- a/jscomp/test/config2_test.mli +++ b/jscomp/test/config2_test.mli @@ -1,4 +1,4 @@ -[@@@bs.config {obj_type_auto_uncurry = true } ] +[@@@bs.config {obj_type_auto_uncurry = true ; (* non_export = true *) } ] class type v = object [@uncurry] diff --git a/lib/js/test/config1_test.js b/lib/js/test/config1_test.js index 6d595e3f79f..1bc545d8f72 100644 --- a/lib/js/test/config1_test.js +++ b/lib/js/test/config1_test.js @@ -2,7 +2,5 @@ 'use strict'; -var a = 3; -exports.a = a; /* No side effect */ From 4592a6afd41c06251f214fc6d6505c07466ac74d Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Wed, 1 Jun 2016 16:01:37 -0400 Subject: [PATCH 5/5] bump a version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b3024148109..b29bc47cb98 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "postinstall": "./scripts/postinstall.sh" }, "name": "bs-platform", - "version": "0.5.4", + "version": "0.5.5", "description": "bucklescript compiler, ocaml standard libary by bucklescript and its required runtime support", "repository": { "type": "git",