Skip to content

Commit 0376138

Browse files
committed
clean up
1 parent b1c9ce0 commit 0376138

File tree

13 files changed

+40
-114
lines changed

13 files changed

+40
-114
lines changed

jscomp/core/lam_dispatch_primitive.ml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ let translate loc (prim_name : string)
8585
-> Js_long.bits_of_float args
8686
| "caml_int64_float_of_bits"
8787
-> Js_long.float_of_bits args
88-
| "caml_int64_bswap"
89-
-> Js_long.swap args
9088
| "caml_int64_min"
9189
-> Js_long.min args
9290
| "caml_int64_max"
@@ -318,27 +316,13 @@ let translate loc (prim_name : string)
318316
call Js_runtime_modules.caml_primitive
319317
| _ -> assert false
320318
end
321-
| "caml_string_get"
322-
->
323-
E.runtime_call Js_runtime_modules.string "get" args
324319
| "caml_fill_bytes"
325320
| "bytes_to_string"
326321
| "bytes_of_string"
327322
| "caml_blit_string"
328323
| "caml_blit_bytes"
329324
->
330325
call Js_runtime_modules.bytes
331-
| "caml_backtrace_status"
332-
| "caml_get_exception_backtrace"
333-
| "caml_get_exception_raw_backtrace"
334-
| "caml_record_backtrace"
335-
| "caml_convert_raw_backtrace"
336-
| "caml_get_current_callstack"
337-
-> E.unit
338-
(* unit -> unit
339-
_ -> unit
340-
major_slice : int -> int
341-
*)
342326
(** Note we captured [exception/extension] creation in the early pass, this primitive is
343327
like normal one to set the identifier *)
344328
| "caml_exn_slot_id"
@@ -358,11 +342,9 @@ let translate loc (prim_name : string)
358342
(* ] *)
359343
| "caml_sys_time"
360344
| "caml_sys_getenv"
361-
| "caml_sys_system_command"
362345
| "caml_sys_getcwd" (* check browser or nodejs *)
363346
| "caml_sys_is_directory"
364347
| "caml_sys_exit"
365-
(* | "caml_sys_file_exists" *)
366348
->
367349
call Js_runtime_modules.sys
368350
| "caml_lex_engine"

jscomp/main/builtin_cmi_datasets.ml

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

jscomp/main/builtin_cmj_datasets.ml

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

jscomp/runtime/caml_sys.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ external readAs : spawnResult ->
7878
*)
7979

8080

81-
let caml_sys_system_command _cmd = 127
8281

8382
let caml_sys_getcwd : unit -> string = [%raw{|function(param){
8483
if (typeof process === "undefined" || process.cwd === undefined){

jscomp/runtime/caml_sys.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ val caml_sys_time : unit -> float
3030

3131
val os_type : unit -> string
3232

33-
val caml_sys_system_command : string -> int
3433

3534
val caml_sys_getcwd : unit -> string
3635

jscomp/stdlib-406/sys.ml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type backend_type =
2323
| Native
2424
| Bytecode
2525
| Other of string
26-
(* System interface *)
26+
(* System interface *)
2727

2828
(* external get_config: unit -> string * int * bool = "caml_sys_get_config" *)
2929
external get_argv: unit -> string * string array = "caml_sys_get_argv"
@@ -37,26 +37,20 @@ external cygwin : unit -> bool = "%ostype_cygwin"
3737
external get_backend_type : unit -> backend_type = "%backend_type"
3838

3939
let (executable_name, argv) = get_argv()
40-
#if BS
40+
4141
external get_os_type : unit -> string = "#os_type"
4242
let os_type = get_os_type ()
43-
#else
44-
let (os_type, _, _) = get_config()
45-
#end
4643
let backend_type = get_backend_type ()
4744
let big_endian = big_endian ()
4845
let word_size = word_size ()
4946
let int_size = int_size ()
5047
let unix = unix ()
5148
let win32 = win32 ()
5249
let cygwin = cygwin ()
53-
#if BS
50+
5451
let max_array_length = 2147483647 (* 2^ 31 - 1 *)
5552
let max_string_length = 2147483647
56-
#else
57-
let max_array_length = max_wosize ()
58-
let max_string_length = word_size / 8 * max_array_length - 1
59-
#end
53+
6054
external runtime_variant : unit -> string = "caml_runtime_variant"
6155
external runtime_parameters : unit -> string = "caml_runtime_parameters"
6256

@@ -66,20 +60,14 @@ external remove: string -> unit = "caml_sys_remove"
6660
external rename : string -> string -> unit = "caml_sys_rename"
6761
external getenv: string -> string = "caml_sys_getenv"
6862

69-
#if BS
63+
7064
external getEnv : 'a -> string -> string option = "" [@@bs.get_index]
7165
let getenv_opt s =
72-
match [%external process ] with
73-
| None -> None
74-
| Some x -> getEnv x##env s
75-
#else
76-
let getenv_opt s =
77-
(* TODO: expose a non-raising primitive directly. *)
78-
try Some (getenv s)
79-
with Not_found -> None
80-
#end
66+
match [%external process ] with
67+
| None -> None
68+
| Some x -> getEnv x#env s
8169

82-
external command: string -> int = "caml_sys_system_command"
70+
let command: string -> int = fun _ -> 127
8371
external time: unit -> (float [@unboxed]) =
8472
"caml_sys_time" "caml_sys_time_unboxed" [@@noalloc]
8573
external chdir: string -> unit = "caml_sys_chdir"
@@ -94,7 +82,7 @@ type signal_behavior =
9482
| Signal_handle of (int -> unit)
9583

9684
let signal : int -> signal_behavior -> signal_behavior
97-
= fun _ _ -> Signal_default
85+
= fun _ _ -> Signal_default
9886

9987
let set_signal sig_num sig_beh = ignore(signal sig_num sig_beh)
10088

@@ -135,15 +123,9 @@ let catch_break on =
135123
else
136124
set_signal sigint Signal_default
137125

138-
#if BS
126+
139127
let enable_runtime_warnings : bool -> unit = fun _ -> ()
140128
let runtime_warnings_enabled : unit -> bool = fun _ -> false
141-
#else
142-
external enable_runtime_warnings: bool -> unit =
143-
"caml_ml_enable_runtime_warnings"
144-
external runtime_warnings_enabled: unit -> bool =
145-
"caml_ml_runtime_warnings_enabled"
146-
#end
147129
(* The version string is found in file ../VERSION *)
148130

149131
let ocaml_version = "4.06.2+BS"

jscomp/stdlib-406/sys.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ val getenv_opt: string -> string option
6262
@since 4.05
6363
*)
6464

65-
external command : string -> int = "caml_sys_system_command"
65+
val command : string -> int
6666
(** Execute the given shell command and return its exit code. *)
6767

6868
external time : unit -> (float [@unboxed]) =

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 6 additions & 24 deletions
Large diffs are not rendered by default.

lib/4.06.1/whole_compiler.ml

Lines changed: 6 additions & 24 deletions
Large diffs are not rendered by default.

lib/es6/caml_sys.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ function caml_sys_time(param) {
3535
}
3636
}
3737

38-
function caml_sys_system_command(_cmd) {
39-
return 127;
40-
}
41-
4238
var caml_sys_getcwd = (function(param){
4339
if (typeof process === "undefined" || process.cwd === undefined){
4440
return "/"
@@ -94,7 +90,6 @@ export {
9490
caml_sys_getenv ,
9591
caml_sys_time ,
9692
os_type ,
97-
caml_sys_system_command ,
9893
caml_sys_getcwd ,
9994
caml_sys_get_argv ,
10095
caml_sys_exit ,

lib/es6/sys.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ function getenv_opt(s) {
2525

2626
}
2727

28+
function command(param) {
29+
return 127;
30+
}
31+
2832
var interactive = {
2933
contents: false
3034
};
@@ -127,6 +131,7 @@ export {
127131
argv ,
128132
executable_name ,
129133
getenv_opt ,
134+
command ,
130135
interactive ,
131136
os_type ,
132137
backend_type ,

lib/js/caml_sys.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ function caml_sys_time(param) {
3535
}
3636
}
3737

38-
function caml_sys_system_command(_cmd) {
39-
return 127;
40-
}
41-
4238
var caml_sys_getcwd = (function(param){
4339
if (typeof process === "undefined" || process.cwd === undefined){
4440
return "/"
@@ -93,7 +89,6 @@ function caml_sys_file_exists(_s) {
9389
exports.caml_sys_getenv = caml_sys_getenv;
9490
exports.caml_sys_time = caml_sys_time;
9591
exports.os_type = os_type;
96-
exports.caml_sys_system_command = caml_sys_system_command;
9792
exports.caml_sys_getcwd = caml_sys_getcwd;
9893
exports.caml_sys_get_argv = caml_sys_get_argv;
9994
exports.caml_sys_exit = caml_sys_exit;

lib/js/sys.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ function getenv_opt(s) {
2525

2626
}
2727

28+
function command(param) {
29+
return 127;
30+
}
31+
2832
var interactive = {
2933
contents: false
3034
};
@@ -126,6 +130,7 @@ var ocaml_version = "4.06.2+BS";
126130
exports.argv = argv;
127131
exports.executable_name = executable_name;
128132
exports.getenv_opt = getenv_opt;
133+
exports.command = command;
129134
exports.interactive = interactive;
130135
exports.os_type = os_type;
131136
exports.backend_type = backend_type;

0 commit comments

Comments
 (0)