Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jscomp/bin/bsb.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2779,9 +2779,9 @@ end = struct
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let version = "1.5.0+dev"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 1.5.0+dev, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down
8 changes: 2 additions & 6 deletions jscomp/bin/bsdep.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ end = struct
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let version = "1.5.0+dev"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 1.5.0+dev, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down Expand Up @@ -23701,8 +23701,6 @@ let is_single_int (x : t ) =
_}] -> Some name
| _ -> None



let as_string_exp (x : t ) =
match x with (** TODO also need detect empty phrase case *)
| PStr [ {
Expand Down Expand Up @@ -25362,8 +25360,6 @@ val bs_method : attr

val warn_unused_attributes : t -> unit



end = struct
#1 "ast_attributes.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
Expand Down
8 changes: 2 additions & 6 deletions jscomp/bin/bsppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5494,8 +5494,6 @@ let is_single_int (x : t ) =
_}] -> Some name
| _ -> None



let as_string_exp (x : t ) =
match x with (** TODO also need detect empty phrase case *)
| PStr [ {
Expand Down Expand Up @@ -7155,8 +7153,6 @@ val bs_method : attr

val warn_unused_attributes : t -> unit



end = struct
#1 "ast_attributes.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
Expand Down Expand Up @@ -9382,9 +9378,9 @@ end = struct
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let version = "1.5.0+dev"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 1.5.0+dev, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down
22 changes: 6 additions & 16 deletions jscomp/bin/whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ end = struct
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let version = "1.5.0+dev"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 1.5.0+dev, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

end
Expand Down Expand Up @@ -69681,9 +69681,10 @@ let rec no_side_effects (lam : Lam.t) : bool =
| _ , _-> false
end
| Pjs_call _ -> false
| Pjs_fn_make _
| Pjs_object_create _ ->
List.for_all no_side_effects args
(** TODO: check *)
(** TODO: check *)
| Pbytes_to_string
| Pbytes_of_string
| Pglobal_exception _
Expand Down Expand Up @@ -69747,7 +69748,7 @@ let rec no_side_effects (lam : Lam.t) : bool =
| Pupdate_mod
| Pjs_unsafe_downgrade _
| Pdebugger
| Pjs_fn_run _ | Pjs_fn_make _
| Pjs_fn_run _
| Pjs_fn_method _ | Pjs_fn_runmethod _
(* TODO *)

Expand Down Expand Up @@ -89558,14 +89559,7 @@ val translate_ffi :
Attributes starting with `js` are reserved
examples: "bs.splice"
*)
(*
val translate :
Location.t ->
Lam_compile_defs.cxt ->
Primitive.description ->
J.expression list ->
J.expression
*)

end = struct
#1 "lam_compile_external_call.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
Expand Down Expand Up @@ -98126,8 +98120,6 @@ let is_single_int (x : t ) =
_}] -> Some name
| _ -> None



let as_string_exp (x : t ) =
match x with (** TODO also need detect empty phrase case *)
| PStr [ {
Expand Down Expand Up @@ -98345,8 +98337,6 @@ val bs_method : attr

val warn_unused_attributes : t -> unit



end = struct
#1 "ast_attributes.ml"
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
Expand Down
4 changes: 2 additions & 2 deletions jscomp/common/bs_version.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
let version = "1.4.3"
let version = "1.5.0+dev"
let header =
"// Generated by BUCKLESCRIPT VERSION 1.4.3, PLEASE EDIT WITH CARE"
"// Generated by BUCKLESCRIPT VERSION 1.5.0+dev, PLEASE EDIT WITH CARE"
let package_name = "bs-platform"

8 changes: 5 additions & 3 deletions jscomp/test/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ for_side_effect_test.cmj : mt.cmj
format_regression.cmj :
format_test.cmj : mt.cmj ../stdlib/format.cmj
fs_test.cmj : ../others/node.cmj mt.cmj ../runtime/js.cmj
functor_ffi.cmj : ../runtime/js.cmj
gbk.cmj : ../runtime/js.cmj
genlex_test.cmj : ../stdlib/stream.cmj mt.cmj ../stdlib/list.cmj \
../stdlib/genlex.cmj
Expand Down Expand Up @@ -236,8 +237,7 @@ int_overflow_test.cmj : ../stdlib/string.cmj mt.cmj ../stdlib/int32.cmj \
io_test.cmj : ../runtime/js.cmj
js_array_test.cmj : mt.cmj ../runtime/js.cmj
js_bool_test.cmj : mt.cmj ../runtime/js.cmj
js_date.cmj : ../runtime/js.cmj
js_date_test.cmj : mt.cmj js_date.cmj
js_date_test.cmj : mt.cmj ../runtime/js_float.cmj ../runtime/js.cmj
js_json_test.cmj : mt.cmj ../runtime/js.cmj
js_obj_test.cmj : mt.cmj
js_re_test.cmj : mt.cmj ../runtime/js.cmj ../stdlib/array.cmj
Expand Down Expand Up @@ -278,7 +278,8 @@ module_missing_conversion.cmj : ../stdlib/string.cmj \
module_parameter_test.cmj : ../stdlib/string.cmj mt.cmj
module_splice_test.cmj : mt.cmj ../runtime/js.cmj
more_uncurry.cmj :
mt.cmj : ../others/node.cmj ../stdlib/list.cmj ../stdlib/array.cmj mt.cmi
mt.cmj : ../others/node.cmj ../stdlib/list.cmj ../runtime/js.cmj \
../stdlib/array.cmj mt.cmi
mt_global.cmj : mt.cmj mt_global.cmi
mutable_obj_test.cmj : ../runtime/js.cmj
mutual_non_recursive_type.cmj :
Expand All @@ -304,6 +305,7 @@ ocaml_proto_test.cmj : ../stdlib/string.cmj ../stdlib/printf.cmj \
../stdlib/char.cmj ocaml_proto_test.cmi
of_string_test.cmj : mt.cmj
offset.cmj : ../stdlib/string.cmj ../stdlib/set.cmj
oo_js_test_date.cmj : mt.cmj ../runtime/js.cmj
optional_ffi_test.cmj : mt.cmj
pipe_send_readline.cmj : ../runtime/js.cmj
poly_type.cmj : ../runtime/js.cmj
Expand Down
3 changes: 2 additions & 1 deletion jscomp/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ OTHERS := literals a test_ari test_export2 test_internalOO test_obj_simple_ffi t
js_re_test\
name_mangle_test\
oo_js_test_date\
bs_uncurry_test
bs_uncurry_test\
functor_ffi


SOURCE_LIST := $(OTHERS)
Expand Down
28 changes: 28 additions & 0 deletions jscomp/test/functor_ffi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

var Js_primitive = require("../../lib/js/js_primitive");

function Make() {
var opt_get = function (f, i) {
return Js_primitive.js_from_def(f[i]);
};
return /* module */[/* opt_get */opt_get];
}

function opt_get(f, i) {
return Js_primitive.js_from_def(f[i]);
}

var Int_arr = /* module */[/* opt_get */opt_get];

function f(v) {
return /* tuple */[
v[0],
Js_primitive.js_from_def(v[1])
];
}

exports.Make = Make;
exports.Int_arr = Int_arr;
exports.f = f;
/* No side effect */
21 changes: 21 additions & 0 deletions jscomp/test/functor_ffi.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@




module Make ( S : sig type elt end ) = struct
open S
type 'a t
external unsafe_get : elt t -> int -> elt = "" [@@bs.get_index]

external get : elt t -> int -> elt Js.undefined = "" [@@bs.get_index]

let opt_get f i =
Js.Undefined.to_opt @@ get f i
end

module Int_arr = Make ( struct type elt = int end)


let f v : int * _ option =
Int_arr.unsafe_get v 0 ,
Int_arr.opt_get v 1
2 changes: 1 addition & 1 deletion lib/es6/bs_dyn.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ export {
shape_of_record ,

}
/* int32_to_value Not a pure module */
/* No side effect */
3 changes: 3 additions & 0 deletions lib/es6/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ var $$Boolean = 0;

var $$Math = 0;

var $$Date = 0;

export {
Null ,
Undefined ,
Expand All @@ -38,6 +40,7 @@ export {
Obj ,
$$Boolean ,
$$Math ,
$$Date ,

}
/* No side effect */
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"postinstall": "node scripts/install.js"
},
"name": "bs-platform",
"version": "1.4.3",
"version": "1.5.0+dev",
"description": "bucklescript compiler, ocaml standard libary by bucklescript and its required runtime support",
"repository": {
"type": "git",
Expand Down