Skip to content

Changes needed to compile reason/refmt with bucklescript #4377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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: 3 additions & 1 deletion jscomp/stdlib-406/obj.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ external truncate : t -> int -> unit = "caml_obj_truncate"




let lazy_tag = 246
let object_tag = 248
let forward_tag = 250


module Ephemeron = struct
Expand Down
3 changes: 3 additions & 0 deletions jscomp/stdlib-406/obj.mli
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ external set_field : t -> int -> t -> unit = "%obj_set_field"
external dup : t -> t = "caml_obj_dup"
external truncate : t -> int -> unit = "caml_obj_truncate"

val lazy_tag : int
val object_tag : int
val forward_tag : int

module Ephemeron: sig
(** Ephemeron with arbitrary arity and untyped *)
Expand Down
4 changes: 2 additions & 2 deletions jscomp/stdlib-406/sys.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type backend_type =
(* System interface *)

(* external get_config: unit -> string * int * bool = "caml_sys_get_config" *)
external get_argv: unit -> string * string array = "caml_sys_get_argv"
external big_endian : unit -> bool = "%big_endian"
external word_size : unit -> int = "%word_size"
external int_size : unit -> int = "%int_size"
Expand All @@ -36,7 +35,8 @@ external win32 : unit -> bool = "%ostype_win32"
external cygwin : unit -> bool = "%ostype_cygwin"
external get_backend_type : unit -> backend_type = "%backend_type"

let (executable_name, argv) = get_argv()
let (executable_name, argv) = "bs-browser", [||]

#if BS then
external get_os_type : unit -> string = "#os_type"
let os_type = get_os_type ()
Expand Down
9 changes: 9 additions & 0 deletions lib/es6/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ function length(x) {
return x.length - 2 | 0;
}

var lazy_tag = 246;

var object_tag = 248;

var forward_tag = 250;

function Ephemeron_create(prim) {
return Caml_external_polyfill.resolve("caml_ephe_create")(prim);
}
Expand Down Expand Up @@ -81,6 +87,9 @@ var Ephemeron = {

export {
is_block ,
lazy_tag ,
object_tag ,
forward_tag ,
Ephemeron ,

}
Expand Down
6 changes: 2 additions & 4 deletions lib/es6/sys.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as Caml_sys from "./caml_sys.js";
import * as Caml_exceptions from "./caml_exceptions.js";

var match = Caml_sys.caml_sys_get_argv(undefined);
var argv = [];

var os_type = Caml_sys.os_type(undefined);

Expand Down Expand Up @@ -45,9 +45,7 @@ function runtime_warnings_enabled(param) {
return false;
}

var argv = match[1];

var executable_name = match[0];
var executable_name = "bs-browser";

var cygwin = false;

Expand Down
9 changes: 9 additions & 0 deletions lib/js/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ function length(x) {
return x.length - 2 | 0;
}

var lazy_tag = 246;

var object_tag = 248;

var forward_tag = 250;

function Ephemeron_create(prim) {
return Caml_external_polyfill.resolve("caml_ephe_create")(prim);
}
Expand Down Expand Up @@ -80,5 +86,8 @@ var Ephemeron = {
};

exports.is_block = is_block;
exports.lazy_tag = lazy_tag;
exports.object_tag = object_tag;
exports.forward_tag = forward_tag;
exports.Ephemeron = Ephemeron;
/* No side effect */
6 changes: 2 additions & 4 deletions lib/js/sys.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var Caml_sys = require("./caml_sys.js");
var Caml_exceptions = require("./caml_exceptions.js");

var match = Caml_sys.caml_sys_get_argv(undefined);
var argv = [];

var os_type = Caml_sys.os_type(undefined);

Expand Down Expand Up @@ -45,9 +45,7 @@ function runtime_warnings_enabled(param) {
return false;
}

var argv = match[1];

var executable_name = match[0];
var executable_name = "bs-browser";

var cygwin = false;

Expand Down