Skip to content

Commit b1c9ce0

Browse files
committed
clean up
1 parent 7d1e796 commit b1c9ce0

File tree

13 files changed

+90
-245
lines changed

13 files changed

+90
-245
lines changed

jscomp/core/lam_dispatch_primitive.ml

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -50,41 +50,6 @@ let translate loc (prim_name : string)
5050
let [@inline] call m =
5151
E.runtime_call m prim_name args in
5252
begin match prim_name with
53-
| "caml_add_float" ->
54-
begin match args with
55-
| [e0;e1] -> E.float_add e0 e1 (** TODO float plus*)
56-
| _ -> assert false
57-
end
58-
|"caml_div_float" ->
59-
begin match args with
60-
| [e0;e1] -> E.float_div e0 e1
61-
| _ -> assert false
62-
end
63-
|"caml_sub_float" ->
64-
begin match args with
65-
| [e0;e1] -> E.float_minus e0 e1
66-
| _ -> assert false
67-
end
68-
| "caml_eq_float" ->
69-
begin match args with
70-
| [e0;e1] -> E.float_equal e0 e1
71-
| _ -> assert false
72-
end
73-
| "caml_ge_float" ->
74-
begin match args with
75-
| [e0;e1] -> E.float_comp Cge e0 e1
76-
| _ -> assert false
77-
end
78-
|"caml_gt_float" ->
79-
begin match args with
80-
| [e0;e1] -> E.float_comp Cgt e0 e1
81-
| _ -> assert false
82-
end
83-
| "caml_float_of_int" ->
84-
begin match args with
85-
| [e] -> e
86-
| _ -> assert false
87-
end
8853
| "caml_int_of_float"
8954
->
9055
begin match args with
@@ -453,8 +418,6 @@ let translate loc (prim_name : string)
453418
| "caml_format_int"
454419
->
455420
call Js_runtime_modules.format
456-
(* "caml_alloc_dummy"; *)
457-
(* TODO: "caml_alloc_dummy_float"; *)
458421
| "caml_obj_dup"
459422
->
460423
call Js_runtime_modules.obj_runtime
@@ -506,14 +469,7 @@ let translate loc (prim_name : string)
506469
| [e] -> E.tag e
507470
| _ -> assert false end
508471

509-
(** TODO: Primitives not implemented yet ...*)
510-
| "caml_install_signal_handler"
511-
->
512-
begin match args with
513-
| [num; behavior]
514-
-> E.seq num behavior (*TODO:*)
515-
| _ -> assert false
516-
end
472+
517473
| "caml_md5_string"
518474
-> call Js_runtime_modules.md5
519475
| "caml_hash_mix_string"

jscomp/main/builtin_cmi_datasets.ml

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

jscomp/main/builtin_cmj_datasets.ml

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

jscomp/stdlib-406/sys.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ type signal_behavior =
9393
| Signal_ignore
9494
| Signal_handle of (int -> unit)
9595

96-
external signal : int -> signal_behavior -> signal_behavior
97-
= "caml_install_signal_handler"
96+
let signal : int -> signal_behavior -> signal_behavior
97+
= fun _ _ -> Signal_default
9898

9999
let set_signal sig_num sig_beh = ignore(signal sig_num sig_beh)
100100

jscomp/stdlib-406/sys.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ type signal_behavior =
173173
- [Signal_handle f]: call function [f], giving it the signal
174174
number as argument. *)
175175

176-
external signal :
177-
int -> signal_behavior -> signal_behavior = "caml_install_signal_handler"
176+
val signal :
177+
int -> signal_behavior -> signal_behavior
178178
(** Set the behavior of the system on receipt of a given signal. The
179179
first argument is the signal number. Return the behavior
180180
previously associated with the signal. If the signal number is

jscomp/test/equal_test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ function int_equal(x, y) {
1111
return x === y;
1212
}
1313

14+
function float_equal(x, y) {
15+
return x === y;
16+
}
17+
1418
var v = false;
1519

1620
exports.str_equal = str_equal;
1721
exports.str_b = str_b;
1822
exports.int_equal = int_equal;
1923
exports.v = v;
24+
exports.float_equal = float_equal;
2025
/* str_b Not a pure module */

jscomp/test/equal_test.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ let str_b = "xx" = "xx"
55
let int_equal (x : int) y = x = y
66

77
let v = 1 = 2
8+
9+
let float_equal (x : float) y = x = y

lib/4.06.1/unstable/js_compiler.ml

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

lib/4.06.1/whole_compiler.ml

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

lib/es6/string.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -351,22 +351,6 @@ function split_on_char(sep, s) {
351351
};
352352
}
353353

354-
function uppercase(s) {
355-
return Caml_bytes.bytes_to_string(Bytes.uppercase(Caml_bytes.bytes_of_string(s)));
356-
}
357-
358-
function lowercase(s) {
359-
return Caml_bytes.bytes_to_string(Bytes.lowercase(Caml_bytes.bytes_of_string(s)));
360-
}
361-
362-
function capitalize(s) {
363-
return Caml_bytes.bytes_to_string(Bytes.capitalize(Caml_bytes.bytes_of_string(s)));
364-
}
365-
366-
function uncapitalize(s) {
367-
return Caml_bytes.bytes_to_string(Bytes.uncapitalize(Caml_bytes.bytes_of_string(s)));
368-
}
369-
370354
var make = Caml_string.make;
371355

372356
var blit = Bytes.blit_string;
@@ -398,10 +382,6 @@ export {
398382
contains ,
399383
contains_from ,
400384
rcontains_from ,
401-
uppercase ,
402-
lowercase ,
403-
capitalize ,
404-
uncapitalize ,
405385
uppercase_ascii ,
406386
lowercase_ascii ,
407387
capitalize_ascii ,

lib/es6/sys.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ var interactive = {
2929
contents: false
3030
};
3131

32+
function signal(param, param$1) {
33+
return /* Signal_default */0;
34+
}
35+
3236
function set_signal(sig_num, sig_beh) {
3337

3438
}
@@ -134,6 +138,7 @@ export {
134138
big_endian ,
135139
max_string_length ,
136140
max_array_length ,
141+
signal ,
137142
set_signal ,
138143
sigabrt ,
139144
sigalrm ,

lib/js/string.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -351,22 +351,6 @@ function split_on_char(sep, s) {
351351
};
352352
}
353353

354-
function uppercase(s) {
355-
return Caml_bytes.bytes_to_string(Bytes.uppercase(Caml_bytes.bytes_of_string(s)));
356-
}
357-
358-
function lowercase(s) {
359-
return Caml_bytes.bytes_to_string(Bytes.lowercase(Caml_bytes.bytes_of_string(s)));
360-
}
361-
362-
function capitalize(s) {
363-
return Caml_bytes.bytes_to_string(Bytes.capitalize(Caml_bytes.bytes_of_string(s)));
364-
}
365-
366-
function uncapitalize(s) {
367-
return Caml_bytes.bytes_to_string(Bytes.uncapitalize(Caml_bytes.bytes_of_string(s)));
368-
}
369-
370354
var make = Caml_string.make;
371355

372356
var blit = Bytes.blit_string;
@@ -397,10 +381,6 @@ exports.rindex_from_opt = rindex_from_opt;
397381
exports.contains = contains;
398382
exports.contains_from = contains_from;
399383
exports.rcontains_from = rcontains_from;
400-
exports.uppercase = uppercase;
401-
exports.lowercase = lowercase;
402-
exports.capitalize = capitalize;
403-
exports.uncapitalize = uncapitalize;
404384
exports.uppercase_ascii = uppercase_ascii;
405385
exports.lowercase_ascii = lowercase_ascii;
406386
exports.capitalize_ascii = capitalize_ascii;

lib/js/sys.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ var interactive = {
2929
contents: false
3030
};
3131

32+
function signal(param, param$1) {
33+
return /* Signal_default */0;
34+
}
35+
3236
function set_signal(sig_num, sig_beh) {
3337

3438
}
@@ -133,6 +137,7 @@ exports.int_size = int_size;
133137
exports.big_endian = big_endian;
134138
exports.max_string_length = max_string_length;
135139
exports.max_array_length = max_array_length;
140+
exports.signal = signal;
136141
exports.set_signal = set_signal;
137142
exports.sigabrt = sigabrt;
138143
exports.sigalrm = sigalrm;

0 commit comments

Comments
 (0)