Skip to content
Merged
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
2 changes: 1 addition & 1 deletion jscomp/core/js_exp_make.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ let not_implemented ?comment (s : string) : t =
runtime_call
Js_runtime_modules.missing_polyfill
"not_implemented"
[str (s ^ " not implemented by bucklescript yet\n")]
[str s]



2 changes: 1 addition & 1 deletion jscomp/runtime/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ caml_oo.cmj : bs_obj.cmj caml_oo.cmi
curry.cmj : caml_array.cmj
caml_oo_curry.cmj : curry.cmj caml_oo.cmj
caml_module.cmj :
caml_missing_polyfill.cmj : caml_missing_polyfill.cmi
caml_missing_polyfill.cmj : js_exn.cmj caml_missing_polyfill.cmi
bs_string.cmj :
js_float.cmj :
js_exn.cmj : caml_exceptions.cmj js_exn.cmi
Expand Down
5 changes: 3 additions & 2 deletions jscomp/runtime/caml_missing_polyfill.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)

let not_implemented : string -> 'a [@bs] =
[%raw{|function (s){ throw new Error(s)}|}]
let not_implemented s =
Js_exn.raiseError (s ^ " not implemented by BuckleScript yet\n")

2 changes: 1 addition & 1 deletion jscomp/runtime/caml_missing_polyfill.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)


val not_implemented : string -> 'a [@bs]
val not_implemented : string -> 'a
12 changes: 6 additions & 6 deletions jscomp/test/bigarray_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ var Caml_missing_polyfill = require("../../lib/js/caml_missing_polyfill.js");

function sum() {
var result = 0;
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1 not implemented by bucklescript yet\n") - 1 | 0; i <= i_finish; ++i){
result = result + Caml_missing_polyfill.not_implemented("caml_ba_get_1 not implemented by bucklescript yet\n") | 0;
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1") - 1 | 0; i <= i_finish; ++i){
result = result + Caml_missing_polyfill.not_implemented("caml_ba_get_1") | 0;
}
return /* () */0;
}

function init(v) {
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1 not implemented by bucklescript yet\n") - 1 | 0; i <= i_finish; ++i){
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1") - 1 | 0; i <= i_finish; ++i){
v[i] = /* array */[
Caml_int32.imul(i, i),
Caml_int32.imul(Caml_int32.imul(i, i), i)
Expand All @@ -23,15 +23,15 @@ function init(v) {
}

function init2(v) {
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1 not implemented by bucklescript yet\n") - 1 | 0; i <= i_finish; ++i){
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1") - 1 | 0; i <= i_finish; ++i){
v[i] = i;
}
return /* () */0;
}

function init3() {
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1 not implemented by bucklescript yet\n") - 1 | 0; i <= i_finish; ++i){
Caml_missing_polyfill.not_implemented("caml_ba_set_1 not implemented by bucklescript yet\n");
for(var i = 0 ,i_finish = Caml_missing_polyfill.not_implemented("caml_ba_dim_1") - 1 | 0; i <= i_finish; ++i){
Caml_missing_polyfill.not_implemented("caml_ba_set_1");
}
return /* () */0;
}
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/ext_filename_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function node_relative_path(node_modules_shorten, file1, dep_file) {
function find_root_filename(_cwd, filename) {
while(true) {
var cwd = _cwd;
if (Caml_missing_polyfill.not_implemented("caml_sys_file_exists not implemented by bucklescript yet\n")) {
if (Caml_missing_polyfill.not_implemented("caml_sys_file_exists")) {
return cwd;
} else {
var cwd$prime = Curry._1(Filename.dirname, cwd);
Expand Down
12 changes: 6 additions & 6 deletions jscomp/test/ocaml_parsetree_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ function highlight_terminfo(ppf, num_lines, lb, locs) {
throw Pervasives.Exit;
}
Caml_io.caml_ml_flush(Pervasives.stdout);
Caml_missing_polyfill.not_implemented("caml_terminfo_backup not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_backup");
var bol = false;
Pervasives.print_string("# ");
for(var pos = 0 ,pos_finish = (lb[/* lex_buffer_len */2] - pos0 | 0) - 1 | 0; pos <= pos_finish; ++pos){
Expand All @@ -1229,21 +1229,21 @@ function highlight_terminfo(ppf, num_lines, lb, locs) {
return pos === loc[/* loc_start */0][/* pos_cnum */3];
}
}(pos)), locs)) {
Caml_missing_polyfill.not_implemented("caml_terminfo_standout not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_standout");
}
if (List.exists((function(pos){
return function (loc) {
return pos === loc[/* loc_end */1][/* pos_cnum */3];
}
}(pos)), locs)) {
Caml_missing_polyfill.not_implemented("caml_terminfo_standout not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_standout");
}
var c = Caml_bytes.get(lb[/* lex_buffer */1], pos + pos0 | 0);
Pervasives.print_char(c);
bol = c === /* "\n" */10;
}
Caml_missing_polyfill.not_implemented("caml_terminfo_standout not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_resume not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_standout");
Caml_missing_polyfill.not_implemented("caml_terminfo_resume");
return Caml_io.caml_ml_flush(Pervasives.stdout);
}

Expand Down Expand Up @@ -1397,7 +1397,7 @@ function highlight_locations(ppf, locs) {
return false;
}
} else {
status[0] = Caml_missing_polyfill.not_implemented("caml_terminfo_setup not implemented by bucklescript yet\n");
status[0] = Caml_missing_polyfill.not_implemented("caml_terminfo_setup");
continue ;
}
} else {
Expand Down
50 changes: 25 additions & 25 deletions jscomp/test/ocaml_typedtree_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ function find_in_path_uncap(path, name) {
var dir = param[0];
var fullname = Filename.concat(dir, name);
var ufullname = Filename.concat(dir, uname);
if (Caml_missing_polyfill.not_implemented("caml_sys_file_exists not implemented by bucklescript yet\n")) {
if (Caml_missing_polyfill.not_implemented("caml_sys_file_exists")) {
return ufullname;
} else if (Caml_missing_polyfill.not_implemented("caml_sys_file_exists not implemented by bucklescript yet\n")) {
} else if (Caml_missing_polyfill.not_implemented("caml_sys_file_exists")) {
return fullname;
} else {
_param = param[1];
Expand All @@ -240,7 +240,7 @@ function find_in_path_uncap(path, name) {

function remove_file() {
try {
return Caml_missing_polyfill.not_implemented("caml_sys_remove not implemented by bucklescript yet\n");
return Caml_missing_polyfill.not_implemented("caml_sys_remove");
}
catch (raw_exn){
var exn = Js_exn.internalToOCamlException(raw_exn);
Expand Down Expand Up @@ -1460,7 +1460,7 @@ function highlight_terminfo(ppf, num_lines, lb, locs) {
throw Pervasives.Exit;
}
Caml_io.caml_ml_flush(Pervasives.stdout);
Caml_missing_polyfill.not_implemented("caml_terminfo_backup not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_backup");
var bol = false;
Pervasives.print_string("# ");
for(var pos = 0 ,pos_finish = (lb[/* lex_buffer_len */2] - pos0 | 0) - 1 | 0; pos <= pos_finish; ++pos){
Expand All @@ -1473,21 +1473,21 @@ function highlight_terminfo(ppf, num_lines, lb, locs) {
return pos === loc[/* loc_start */0][/* pos_cnum */3];
}
}(pos)), locs)) {
Caml_missing_polyfill.not_implemented("caml_terminfo_standout not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_standout");
}
if (List.exists((function(pos){
return function (loc) {
return pos === loc[/* loc_end */1][/* pos_cnum */3];
}
}(pos)), locs)) {
Caml_missing_polyfill.not_implemented("caml_terminfo_standout not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_standout");
}
var c = Caml_bytes.get(lb[/* lex_buffer */1], pos + pos0 | 0);
Pervasives.print_char(c);
bol = c === /* "\n" */10;
}
Caml_missing_polyfill.not_implemented("caml_terminfo_standout not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_resume not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_terminfo_standout");
Caml_missing_polyfill.not_implemented("caml_terminfo_resume");
return Caml_io.caml_ml_flush(Pervasives.stdout);
}

Expand Down Expand Up @@ -1641,7 +1641,7 @@ function highlight_locations(ppf, locs) {
return false;
}
} else {
status[0] = Caml_missing_polyfill.not_implemented("caml_terminfo_setup not implemented by bucklescript yet\n");
status[0] = Caml_missing_polyfill.not_implemented("caml_terminfo_setup");
continue ;
}
} else {
Expand Down Expand Up @@ -5343,9 +5343,9 @@ function backtrack(param) {
var $$Error$1 = Caml_exceptions.create("Ocaml_typedtree_test.Cmi_format.Error");

function input_cmi() {
var match = Caml_missing_polyfill.not_implemented("caml_input_value not implemented by bucklescript yet\n");
var crcs = Caml_missing_polyfill.not_implemented("caml_input_value not implemented by bucklescript yet\n");
var flags = Caml_missing_polyfill.not_implemented("caml_input_value not implemented by bucklescript yet\n");
var match = Caml_missing_polyfill.not_implemented("caml_input_value");
var crcs = Caml_missing_polyfill.not_implemented("caml_input_value");
var flags = Caml_missing_polyfill.not_implemented("caml_input_value");
return /* record */[
/* cmi_name */match[0],
/* cmi_sign */match[1],
Expand All @@ -5359,7 +5359,7 @@ function read_cmi(filename) {
try {
var buffer = Pervasives.really_input_string(ic, cmi_magic_number.length);
if (buffer !== cmi_magic_number) {
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
var pre_len = cmi_magic_number.length - 3 | 0;
if ($$String.sub(buffer, 0, pre_len) === $$String.sub(cmi_magic_number, 0, pre_len)) {
var msg = buffer < cmi_magic_number ? "an older" : "a newer";
Expand All @@ -5378,25 +5378,25 @@ function read_cmi(filename) {
}
}
var cmi = input_cmi(ic);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
return cmi;
}
catch (raw_exn){
var exn = Js_exn.internalToOCamlException(raw_exn);
if (exn === Caml_builtin_exceptions.end_of_file) {
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
throw [
$$Error$1,
/* Corrupted_interface */Block.__(2, [filename])
];
} else if (exn[0] === Caml_builtin_exceptions.failure) {
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
throw [
$$Error$1,
/* Corrupted_interface */Block.__(2, [filename])
];
} else if (exn[0] === $$Error$1) {
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
throw [
$$Error$1,
exn[1]
Expand All @@ -5409,11 +5409,11 @@ function read_cmi(filename) {

function output_cmi(filename, oc, _) {
Pervasives.output_string(oc, cmi_magic_number);
Caml_missing_polyfill.not_implemented("caml_output_value not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_output_value");
Caml_io.caml_ml_flush(oc);
var crc = Digest.file(filename);
Caml_missing_polyfill.not_implemented("caml_output_value not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_output_value not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_output_value");
Caml_missing_polyfill.not_implemented("caml_output_value");
return crc;
}

Expand Down Expand Up @@ -12446,7 +12446,7 @@ function save_signature(sg, modname, filename) {
];
var crc = output_cmi(filename$1, oc, cmi);
Caml_io.caml_ml_flush(oc);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
var comps = components_of_module(empty, identity, /* Pident */Block.__(0, [/* record */[
/* stamp */0,
/* name */modname$1,
Expand All @@ -12472,7 +12472,7 @@ function save_signature(sg, modname, filename) {
}
catch (exn){
Caml_io.caml_ml_flush(oc);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
remove_file(filename$1);
throw exn;
}
Expand Down Expand Up @@ -23564,7 +23564,7 @@ function clear_env(binary_annots) {

function output_cmt(oc, _) {
Pervasives.output_string(oc, "Caml2012T004");
return Caml_missing_polyfill.not_implemented("caml_output_value not implemented by bucklescript yet\n");
return Caml_missing_polyfill.not_implemented("caml_output_value");
}

var saved_types = [/* [] */0];
Expand Down Expand Up @@ -23646,7 +23646,7 @@ function save_cmt(filename, modname, binary_annots, sourcefile, initial_env, sg)
];
output_cmt(oc, cmt);
Caml_io.caml_ml_flush(oc);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
}
return clear(/* () */0);
}
Expand Down Expand Up @@ -75808,7 +75808,7 @@ function type_implementation_more(sourcefile, outputprefix, modulename, initial_
} else {
var sourceintf = chop_extension_if_any(sourcefile) + interface_suffix[0];
var mli_status = assume_no_mli[0];
if (mli_status === /* Mli_na */0 && Caml_missing_polyfill.not_implemented("caml_sys_file_exists not implemented by bucklescript yet\n") || mli_status === /* Mli_exists */1) {
if (mli_status === /* Mli_na */0 && Caml_missing_polyfill.not_implemented("caml_sys_file_exists") || mli_status === /* Mli_exists */1) {
var intf_file;
try {
intf_file = find_in_path_uncap(load_path[0], modulename + ".cmi");
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/qcc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ function main() {
top(/* () */0);
elfgen(oc);
Caml_io.caml_ml_flush(oc);
return Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
return Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
}
}

Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/scanf_io.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function write_tscanf_data_file(fname, lines) {
create_tscanf_data(ob, lines);
$$Buffer.output_buffer(oc, ob);
Caml_io.caml_ml_flush(oc);
return Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
return Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
}

function get_lines(fname) {
Expand Down
8 changes: 4 additions & 4 deletions jscomp/test/sexpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ function _with_in(filename, f) {
var ic = Pervasives.open_in_bin(filename);
try {
var x = Curry._1(f, ic);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
return x;
}
catch (raw_e){
var e = Js_exn.internalToOCamlException(raw_e);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
return /* `Error */[
106380200,
Printexc.to_string(e)
Expand Down Expand Up @@ -318,12 +318,12 @@ function to_file_seq(filename, seq) {
try {
var x = Curry._1(f, oc);
Caml_io.caml_ml_flush(oc);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
return x;
}
catch (e){
Caml_io.caml_ml_flush(oc);
Caml_missing_polyfill.not_implemented("caml_ml_close_channel not implemented by bucklescript yet\n");
Caml_missing_polyfill.not_implemented("caml_ml_close_channel");
throw e;
}
}
Expand Down
Loading