Skip to content

Commit f01e494

Browse files
committed
remove nativeint which does not make sense in js platform
1 parent 8265044 commit f01e494

File tree

5 files changed

+86
-10
lines changed

5 files changed

+86
-10
lines changed

jscomp/stdlib-406/release.ninja

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ build stdlib-406/moreLabels.cmj : cc_cmi stdlib-406/moreLabels.ml | stdlib-406/h
7979
bsc_flags = $bsc_flags -nolabels
8080
build stdlib-406/moreLabels.cmi : cc stdlib-406/moreLabels.mli | stdlib-406/hashtbl.cmi stdlib-406/map.cmi stdlib-406/pervasives.cmj stdlib-406/set.cmi others
8181
bsc_flags = $bsc_flags -nolabels
82-
build stdlib-406/nativeint.cmj : cc_cmi stdlib-406/nativeint.ml | stdlib-406/nativeint.cmi stdlib-406/pervasives.cmj stdlib-406/sys.cmj others
83-
build stdlib-406/nativeint.cmi : cc stdlib-406/nativeint.mli | stdlib-406/pervasives.cmj others
8482
build stdlib-406/obj.cmj : cc_cmi stdlib-406/obj.ml | stdlib-406/obj.cmi others
8583
build stdlib-406/obj.cmi : cc stdlib-406/obj.mli | stdlib-406/pervasives.cmj others
8684
build stdlib-406/parsing.cmj : cc_cmi stdlib-406/parsing.ml | stdlib-406/array.cmj stdlib-406/lexing.cmj stdlib-406/obj.cmj stdlib-406/parsing.cmi others
@@ -118,4 +116,4 @@ build stdlib-406/sys.cmj : cc_cmi stdlib-406/sys.ml | stdlib-406/sys.cmi others
118116
build stdlib-406/sys.cmi : cc stdlib-406/sys.mli | stdlib-406/pervasives.cmj others
119117
build stdlib-406/uchar.cmj : cc_cmi stdlib-406/uchar.ml | stdlib-406/char.cmj stdlib-406/pervasives.cmj stdlib-406/uchar.cmi others
120118
build stdlib-406/uchar.cmi : cc stdlib-406/uchar.mli | stdlib-406/pervasives.cmj others
121-
build $stdlib : phony stdlib-406/camlinternalFormatBasics.cmi stdlib-406/camlinternalFormatBasics.cmj stdlib-406/pervasives.cmi stdlib-406/pervasives.cmj stdlib-406/arg.cmi stdlib-406/arg.cmj stdlib-406/array.cmi stdlib-406/array.cmj stdlib-406/arrayLabels.cmi stdlib-406/arrayLabels.cmj stdlib-406/buffer.cmi stdlib-406/buffer.cmj stdlib-406/bytes.cmi stdlib-406/bytes.cmj stdlib-406/bytesLabels.cmi stdlib-406/bytesLabels.cmj stdlib-406/callback.cmi stdlib-406/callback.cmj stdlib-406/camlinternalBigarray.cmi stdlib-406/camlinternalBigarray.cmj stdlib-406/camlinternalFormat.cmi stdlib-406/camlinternalFormat.cmj stdlib-406/camlinternalLazy.cmi stdlib-406/camlinternalLazy.cmj stdlib-406/camlinternalMod.cmi stdlib-406/camlinternalMod.cmj stdlib-406/camlinternalOO.cmi stdlib-406/camlinternalOO.cmj stdlib-406/char.cmi stdlib-406/char.cmj stdlib-406/complex.cmi stdlib-406/complex.cmj stdlib-406/digest.cmi stdlib-406/digest.cmj stdlib-406/filename.cmi stdlib-406/filename.cmj stdlib-406/format.cmi stdlib-406/format.cmj stdlib-406/genlex.cmi stdlib-406/genlex.cmj stdlib-406/hashtbl.cmi stdlib-406/hashtbl.cmj stdlib-406/int32.cmi stdlib-406/int32.cmj stdlib-406/int64.cmi stdlib-406/int64.cmj stdlib-406/lazy.cmi stdlib-406/lazy.cmj stdlib-406/lexing.cmi stdlib-406/lexing.cmj stdlib-406/list.cmi stdlib-406/list.cmj stdlib-406/listLabels.cmi stdlib-406/listLabels.cmj stdlib-406/map.cmi stdlib-406/map.cmj stdlib-406/marshal.cmi stdlib-406/marshal.cmj stdlib-406/moreLabels.cmi stdlib-406/moreLabels.cmj stdlib-406/nativeint.cmi stdlib-406/nativeint.cmj stdlib-406/obj.cmi stdlib-406/obj.cmj stdlib-406/parsing.cmi stdlib-406/parsing.cmj stdlib-406/printexc.cmi stdlib-406/printexc.cmj stdlib-406/printf.cmi stdlib-406/printf.cmj stdlib-406/queue.cmi stdlib-406/queue.cmj stdlib-406/random.cmi stdlib-406/random.cmj stdlib-406/scanf.cmi stdlib-406/scanf.cmj stdlib-406/set.cmi stdlib-406/set.cmj stdlib-406/sort.cmi stdlib-406/sort.cmj stdlib-406/stack.cmi stdlib-406/stack.cmj stdlib-406/stdLabels.cmi stdlib-406/stdLabels.cmj stdlib-406/std_exit.cmi stdlib-406/std_exit.cmj stdlib-406/stream.cmi stdlib-406/stream.cmj stdlib-406/string.cmi stdlib-406/string.cmj stdlib-406/stringLabels.cmi stdlib-406/stringLabels.cmj stdlib-406/sys.cmi stdlib-406/sys.cmj stdlib-406/uchar.cmi stdlib-406/uchar.cmj
119+
build $stdlib : phony stdlib-406/camlinternalFormatBasics.cmi stdlib-406/camlinternalFormatBasics.cmj stdlib-406/pervasives.cmi stdlib-406/pervasives.cmj stdlib-406/arg.cmi stdlib-406/arg.cmj stdlib-406/array.cmi stdlib-406/array.cmj stdlib-406/arrayLabels.cmi stdlib-406/arrayLabels.cmj stdlib-406/buffer.cmi stdlib-406/buffer.cmj stdlib-406/bytes.cmi stdlib-406/bytes.cmj stdlib-406/bytesLabels.cmi stdlib-406/bytesLabels.cmj stdlib-406/callback.cmi stdlib-406/callback.cmj stdlib-406/camlinternalBigarray.cmi stdlib-406/camlinternalBigarray.cmj stdlib-406/camlinternalFormat.cmi stdlib-406/camlinternalFormat.cmj stdlib-406/camlinternalLazy.cmi stdlib-406/camlinternalLazy.cmj stdlib-406/camlinternalMod.cmi stdlib-406/camlinternalMod.cmj stdlib-406/camlinternalOO.cmi stdlib-406/camlinternalOO.cmj stdlib-406/char.cmi stdlib-406/char.cmj stdlib-406/complex.cmi stdlib-406/complex.cmj stdlib-406/digest.cmi stdlib-406/digest.cmj stdlib-406/filename.cmi stdlib-406/filename.cmj stdlib-406/format.cmi stdlib-406/format.cmj stdlib-406/genlex.cmi stdlib-406/genlex.cmj stdlib-406/hashtbl.cmi stdlib-406/hashtbl.cmj stdlib-406/int32.cmi stdlib-406/int32.cmj stdlib-406/int64.cmi stdlib-406/int64.cmj stdlib-406/lazy.cmi stdlib-406/lazy.cmj stdlib-406/lexing.cmi stdlib-406/lexing.cmj stdlib-406/list.cmi stdlib-406/list.cmj stdlib-406/listLabels.cmi stdlib-406/listLabels.cmj stdlib-406/map.cmi stdlib-406/map.cmj stdlib-406/marshal.cmi stdlib-406/marshal.cmj stdlib-406/moreLabels.cmi stdlib-406/moreLabels.cmj stdlib-406/obj.cmi stdlib-406/obj.cmj stdlib-406/parsing.cmi stdlib-406/parsing.cmj stdlib-406/printexc.cmi stdlib-406/printexc.cmj stdlib-406/printf.cmi stdlib-406/printf.cmj stdlib-406/queue.cmi stdlib-406/queue.cmj stdlib-406/random.cmi stdlib-406/random.cmj stdlib-406/scanf.cmi stdlib-406/scanf.cmj stdlib-406/set.cmi stdlib-406/set.cmj stdlib-406/sort.cmi stdlib-406/sort.cmj stdlib-406/stack.cmi stdlib-406/stack.cmj stdlib-406/stdLabels.cmi stdlib-406/stdLabels.cmj stdlib-406/std_exit.cmi stdlib-406/std_exit.cmj stdlib-406/stream.cmi stdlib-406/stream.cmj stdlib-406/string.cmi stdlib-406/string.cmj stdlib-406/stringLabels.cmi stdlib-406/stringLabels.cmj stdlib-406/sys.cmi stdlib-406/sys.cmj stdlib-406/uchar.cmi stdlib-406/uchar.cmj

jscomp/test/build.ninja

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ build test/gpr_858_test.cmi test/gpr_858_test.cmj : cc test/gpr_858_test.ml | $s
336336
build test/gpr_858_unit2_test.cmi test/gpr_858_unit2_test.cmj : cc test/gpr_858_unit2_test.ml | $stdlib
337337
build test/gpr_904_test.cmi test/gpr_904_test.cmj : cc test/gpr_904_test.ml | test/mt.cmj $stdlib
338338
build test/gpr_974_test.cmi test/gpr_974_test.cmj : cc test/gpr_974_test.ml | $stdlib
339-
build test/gpr_977_test.cmi test/gpr_977_test.cmj : cc test/gpr_977_test.ml | test/mt.cmj $stdlib
339+
build test/gpr_977_test.cmi test/gpr_977_test.cmj : cc test/gpr_977_test.ml | test/mt.cmj test/nativeint.cmj $stdlib
340340
build test/gpr_return_type_unused_attribute.cmi test/gpr_return_type_unused_attribute.cmj : cc test/gpr_return_type_unused_attribute.ml | $stdlib
341341
build test/gray_code_test.cmi test/gray_code_test.cmj : cc test/gray_code_test.ml | $stdlib
342342
build test/guide_for_ext.cmi test/guide_for_ext.cmj : cc test/guide_for_ext.ml | $stdlib
@@ -374,7 +374,7 @@ build test/int32_test.cmi test/int32_test.cmj : cc test/int32_test.ml | test/ext
374374
build test/int64_mul_div_test.cmi test/int64_mul_div_test.cmj : cc test/int64_mul_div_test.ml | test/mt.cmj $stdlib
375375
build test/int64_string_bench.cmi test/int64_string_bench.cmj : cc test/int64_string_bench.ml | $stdlib
376376
build test/int64_string_test.cmi test/int64_string_test.cmj : cc test/int64_string_test.ml | test/mt.cmj $stdlib
377-
build test/int64_test.cmi test/int64_test.cmj : cc test/int64_test.ml | test/ext_array_test.cmj test/mt.cmj $stdlib
377+
build test/int64_test.cmi test/int64_test.cmj : cc test/int64_test.ml | test/ext_array_test.cmj test/mt.cmj test/nativeint.cmj $stdlib
378378
build test/int_hashtbl_test.cmi test/int_hashtbl_test.cmj : cc test/int_hashtbl_test.ml | test/mt.cmj $stdlib
379379
build test/int_map.cmi test/int_map.cmj : cc test/int_map.ml | $stdlib
380380
build test/int_overflow_test.cmi test/int_overflow_test.cmj : cc test/int_overflow_test.ml | test/mt.cmj $stdlib
@@ -453,6 +453,8 @@ build test/mutable_obj_test.cmi test/mutable_obj_test.cmj : cc test/mutable_obj_
453453
build test/mutable_uncurry_test.cmi test/mutable_uncurry_test.cmj : cc test/mutable_uncurry_test.ml | test/mt.cmj $stdlib
454454
build test/mutual_non_recursive_type.cmi test/mutual_non_recursive_type.cmj : cc test/mutual_non_recursive_type.ml | $stdlib
455455
build test/name_mangle_test.cmi test/name_mangle_test.cmj : cc test/name_mangle_test.ml | test/mt.cmj $stdlib
456+
build test/nativeint.cmj : cc_cmi test/nativeint.ml | test/nativeint.cmi $stdlib
457+
build test/nativeint.cmi : cc test/nativeint.mli | $stdlib
456458
build test/nested_include.cmi test/nested_include.cmj : cc test/nested_include.ml | $stdlib
457459
build test/nested_module_alias.cmi test/nested_module_alias.cmj : cc test/nested_module_alias.ml | $stdlib
458460
build test/nested_obj_literal.cmi test/nested_obj_literal.cmj : cc test/nested_obj_literal.ml | $stdlib
@@ -470,12 +472,12 @@ build test/obj_magic_test.cmi test/obj_magic_test.cmj : cc test/obj_magic_test.m
470472
build test/obj_repr_test.cmi test/obj_repr_test.cmj : cc test/obj_repr_test.ml | $stdlib
471473
build test/obj_test.cmi test/obj_test.cmj : cc test/obj_test.ml | test/mt.cmj $stdlib
472474
build test/obj_type_test.cmi test/obj_type_test.cmj : cc test/obj_type_test.ml | $stdlib
473-
build test/ocaml_parsetree_test.cmj : cc_cmi test/ocaml_parsetree_test.ml | test/ocaml_parsetree_test.cmi $stdlib
475+
build test/ocaml_parsetree_test.cmj : cc_cmi test/ocaml_parsetree_test.ml | test/nativeint.cmj test/ocaml_parsetree_test.cmi $stdlib
474476
build test/ocaml_parsetree_test.cmi : cc test/ocaml_parsetree_test.mli | $stdlib
475477
build test/ocaml_proto_test.cmj : cc_cmi test/ocaml_proto_test.ml | test/mt.cmj test/ocaml_proto_test.cmi $stdlib
476478
build test/ocaml_proto_test.cmi : cc test/ocaml_proto_test.mli | $stdlib
477479
build test/ocaml_re_test.cmi test/ocaml_re_test.cmj : cc test/ocaml_re_test.ml | test/mt.cmj $stdlib
478-
build test/ocaml_typedtree_test.cmj : cc_cmi test/ocaml_typedtree_test.ml | test/ocaml_typedtree_test.cmi $stdlib
480+
build test/ocaml_typedtree_test.cmj : cc_cmi test/ocaml_typedtree_test.ml | test/nativeint.cmj test/ocaml_typedtree_test.cmi $stdlib
479481
build test/ocaml_typedtree_test.cmi : cc test/ocaml_typedtree_test.mli | $stdlib
480482
build test/of_string_test.cmi test/of_string_test.cmj : cc test/of_string_test.ml | test/mt.cmj $stdlib
481483
build test/offset.cmi test/offset.cmj : cc test/offset.ml | $stdlib
@@ -485,7 +487,7 @@ build test/opr_4560_test.cmi test/opr_4560_test.cmj : cc test/opr_4560_test.ml |
485487
build test/option_repr_test.cmi test/option_repr_test.cmj : cc test/option_repr_test.ml | test/mt.cmj $stdlib
486488
build test/optional_ffi_test.cmi test/optional_ffi_test.cmj : cc test/optional_ffi_test.ml | test/mt.cmj $stdlib
487489
build test/optional_regression_test.cmi test/optional_regression_test.cmj : cc test/optional_regression_test.ml | test/mt.cmj $stdlib
488-
build test/parser_api.cmi test/parser_api.cmj : cc test/parser_api.ml | $stdlib
490+
build test/parser_api.cmi test/parser_api.cmj : cc test/parser_api.ml | test/nativeint.cmj $stdlib
489491
build test/parser_api_test.cmi test/parser_api_test.cmj : cc test/parser_api_test.ml | test/mt.cmj test/parser_api.cmj $stdlib
490492
build test/pipe_send_readline.cmi test/pipe_send_readline.cmj : cc test/pipe_send_readline.ml | $stdlib
491493
build test/pipe_syntax.cmi test/pipe_syntax.cmj : cc test/pipe_syntax.ml | $stdlib
@@ -564,7 +566,7 @@ build test/sexp.cmi : cc test/sexp.mli | $stdlib
564566
build test/sexpm.cmj : cc_cmi test/sexpm.ml | test/sexpm.cmi $stdlib
565567
build test/sexpm.cmi : cc test/sexpm.mli | $stdlib
566568
build test/sexpm_test.cmi test/sexpm_test.cmj : cc test/sexpm_test.ml | test/mt.cmj test/sexpm.cmj $stdlib
567-
build test/shift_test.cmi test/shift_test.cmj : cc test/shift_test.ml | $stdlib
569+
build test/shift_test.cmi test/shift_test.cmj : cc test/shift_test.ml | test/nativeint.cmj $stdlib
568570
build test/side_effect.cmi test/side_effect.cmj : cc test/side_effect.ml | $stdlib
569571
build test/side_effect_free.cmi test/side_effect_free.cmj : cc test/side_effect_free.ml | $stdlib
570572
build test/simple_derive_test.cmj : cc_cmi test/simple_derive_test.ml | test/simple_derive_test.cmi $stdlib
@@ -716,7 +718,7 @@ build test/ticker.cmi test/ticker.cmj : cc test/ticker.ml | $stdlib
716718
build test/to_string_test.cmi test/to_string_test.cmj : cc test/to_string_test.ml | test/mt.cmj $stdlib
717719
build test/topsort_test.cmi test/topsort_test.cmj : cc test/topsort_test.ml | $stdlib
718720
build test/tramp_fib.cmi test/tramp_fib.cmj : cc test/tramp_fib.ml | test/mt.cmj $stdlib
719-
build test/tscanf_test.cmi test/tscanf_test.cmj : cc test/tscanf_test.ml | test/mt.cmj test/mt_global.cmj test/testing.cmj $stdlib
721+
build test/tscanf_test.cmi test/tscanf_test.cmj : cc test/tscanf_test.ml | test/mt.cmj test/mt_global.cmj test/nativeint.cmj test/testing.cmj $stdlib
720722
build test/tuple_alloc.cmi test/tuple_alloc.cmj : cc test/tuple_alloc.ml | $stdlib
721723
build test/type_disambiguate.cmi test/type_disambiguate.cmj : cc test/type_disambiguate.ml | $stdlib
722724
build test/typeof_test.cmi test/typeof_test.cmj : cc test/typeof_test.ml | test/mt.cmj $stdlib

jscomp/test/nativeint.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
'use strict';
2+
3+
var Caml_format = require("../../lib/js/caml_format.js");
4+
var Caml_primitive = require("../../lib/js/caml_primitive.js");
5+
var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js");
6+
7+
function succ(n) {
8+
return n + 1;
9+
}
10+
11+
function pred(n) {
12+
return n - 1;
13+
}
14+
15+
function abs(n) {
16+
if (n >= 0) {
17+
return n;
18+
} else {
19+
return -n;
20+
}
21+
}
22+
23+
function lognot(n) {
24+
return n ^ -1;
25+
}
26+
27+
function to_string(n) {
28+
return Caml_format.caml_nativeint_format("%d", n);
29+
}
30+
31+
function of_string_opt(s) {
32+
try {
33+
return Caml_format.caml_nativeint_of_string(s);
34+
}
35+
catch (raw_exn){
36+
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
37+
if (exn.RE_EXN_ID === "Failure") {
38+
return ;
39+
}
40+
throw exn;
41+
}
42+
}
43+
44+
var compare = Caml_primitive.caml_nativeint_compare;
45+
46+
function equal(x, y) {
47+
return Caml_primitive.caml_nativeint_compare(x, y) === 0;
48+
}
49+
50+
var zero = 0;
51+
52+
var one = 1;
53+
54+
var minus_one = -1;
55+
56+
var size = 54;
57+
58+
var max_int = 9007199254740991;
59+
60+
var min_int = -9007199254740991;
61+
62+
exports.zero = zero;
63+
exports.one = one;
64+
exports.minus_one = minus_one;
65+
exports.succ = succ;
66+
exports.pred = pred;
67+
exports.abs = abs;
68+
exports.size = size;
69+
exports.max_int = max_int;
70+
exports.min_int = min_int;
71+
exports.lognot = lognot;
72+
exports.of_string_opt = of_string_opt;
73+
exports.to_string = to_string;
74+
exports.compare = compare;
75+
exports.equal = equal;
76+
/* No side effect */
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)