Skip to content

Commit 737215f

Browse files
authored
Merge pull request #628 from bloomberg/better_top
Better top with Js support !
2 parents d63640c + f84abe8 commit 737215f

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

jscomp/bin/bs_ppx.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(** Bundled by ocamlpack 08/11-11:32 *)
1+
(** Bundled by ocamlpack 08/11-22:12 *)
22
module String_map : sig
33
#1 "string_map.mli"
44
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -2923,6 +2923,7 @@ let runtime_set =
29232923
array ;
29242924
format ;
29252925
string ;
2926+
bytes;
29262927
float ;
29272928
hash ;
29282929
oo ;

jscomp/bin/compiler.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(** Bundled by ocamlpack 08/11-11:32 *)
1+
(** Bundled by ocamlpack 08/11-22:12 *)
22
module String_map : sig
33
#1 "string_map.mli"
44
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -2923,6 +2923,7 @@ let runtime_set =
29232923
array ;
29242924
format ;
29252925
string ;
2926+
bytes;
29262927
float ;
29272928
hash ;
29282929
oo ;

jscomp/common/js_config.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ let runtime_set =
269269
array ;
270270
format ;
271271
string ;
272+
bytes;
272273
float ;
273274
hash ;
274275
oo ;

jscomp/js.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ set -e
33
## building js
44
# ocamlbuild -use-ocamlfind -no-hygiene -syntax camlp4o -pkgs js_of_ocaml,js_of_ocaml.syntax,js_of_ocaml.toplevel exports.byte
55

6-
ocamlbuild -lflags -no-check-prims -use-ocamlfind -no-hygiene -pkgs compiler-libs.toplevel -no-links jsoo_exports.byte
7-
js_of_ocaml -I +compiler-libs --toplevel +dynlink.js +toplevel.js +weak.js _build/jsoo_exports.byte -o _build/exports.js
6+
ocamlbuild -lflags -no-check-prims -use-ocamlfind -no-hygiene -pkgs compiler-libs.bytecomp -no-links jsoo_exports.byte
7+
js_of_ocaml -I +compiler-libs --toplevel +dynlink.js +toplevel.js +weak.js _build/jsoo_exports.byte -I ./runtime/ --file js.cmi:/cmis --file js_unsafe.cmi:/cmis --file js_re.cmi:/cmis -o _build/exports.js
88

9-
10-
rm -rf $BUCKLESCRIPT_DOC/js-demo/exports.js && cp _build/exports.js $BUCKLESCRIPT_DOC/js-demo/exports.js
9+
rm -rf $BUCKLESCRIPT_DOC/js-demo/exports.js && cp _build/exports.js $BUCKLESCRIPT_DOC/js-demo/
1110

1211
ocamlbuild -use-ocamlfind -no-hygiene -no-links js_generate_require.byte --
1312
rm -rf $BUCKLESCRIPT_DOC/js-demo/pre_load.js

jscomp/js_generate_require.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let () =
3939
Ext_pervasives.with_file_as_chan "./pre_load.js"
4040
(fun chan ->
4141
output_string chan
42-
(Printf.sprintf "require([%s], function(){})"
42+
(Printf.sprintf "function start(gist){require([%s], function(){loadGist(gist)})}"
4343
(String.concat ","
4444
(List.map (Printf.sprintf "%S" )
4545
(std_files @ runtime_files)

jscomp/jsoo_exports.ml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,17 @@ let export (field : string) v =
5353
Js.Unsafe.set (Js.Unsafe.global) field v
5454
;;
5555

56+
(* To add a directory to the load path *)
57+
58+
let dir_directory d =
59+
Config.load_path := d :: !Config.load_path
60+
5661

5762
let () =
58-
Sys.interactive := false;
59-
Topdirs.dir_directory "/cmis";
60-
Toploop.initialize_toplevel_env ();
61-
Toploop.input_name := "//toplevel//";
63+
Sys.interactive := false; (* TODO: remove *)
64+
dir_directory "/cmis";
65+
(* Toploop.initialize_toplevel_env (); *)
66+
(* Toploop.input_name := "//toplevel//"; *)
6267
Sys.interactive := true
6368

6469

0 commit comments

Comments
 (0)