Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

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/bin/whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96800,7 +96800,7 @@ and
let () = Ext_log.dwarn __LOC__ "\n@[[TIME:]Lifthenelse: %f@]@." (Sys.time () *. 1000.) in
#end
*)
Js_output.make [S.return (E.econd e out1 out2)] ~finished:True
Js_output.make (b @ [S.return (E.econd e out1 out2)]) ~finished:True
| _, _, _ ->
(*
#if BS_DEBUG then
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/lam_compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ and
let () = Ext_log.dwarn __LOC__ "\n@[[TIME:]Lifthenelse: %f@]@." (Sys.time () *. 1000.) in
#end
*)
Js_output.make [S.return (E.econd e out1 out2)] ~finished:True
Js_output.make (b @ [S.return (E.econd e out1 out2)]) ~finished:True
| _, _, _ ->
(*
#if BS_DEBUG then
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/lam_compile_group.ml
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ let lambda_as_module
begin
Js_config.set_current_file filename ;
#if BS_DEBUG then
Js_config.set_debug_file "gpr_1716_test.ml";
Js_config.set_debug_file "gpr_1728_test.ml";
#end
let lambda_output = compile ~filename output_prefix env sigs lam in
let (//) = Filename.concat in
Expand Down
1 change: 1 addition & 0 deletions jscomp/test/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ gpr_1698_test.cmj : ../runtime/js.cmj
gpr_1701_test.cmj : ../stdlib/list.cmj
gpr_1716_test.cmj : mt.cmj
gpr_1717_test.cmj :
gpr_1728_test.cmj : mt.cmj
gpr_405_test.cmj : ../stdlib/hashtbl.cmj gpr_405_test.cmi
gpr_441.cmj :
gpr_459_test.cmj : mt.cmj
Expand Down
3 changes: 2 additions & 1 deletion jscomp/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ OTHERS := literals a test_ari test_export2 test_internalOO test_obj_simple_ffi t
gpr_1701_test\
gpr_1698_test\
gpr_1717_test\
gpr_1716_test
gpr_1716_test\
gpr_1728_test

# bs_uncurry_test
# needs Lam to get rid of Uncurry arity first
Expand Down
49 changes: 49 additions & 0 deletions jscomp/test/gpr_1728_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict';

var Mt = require("./mt.js");
var Block = require("../../lib/js/block.js");
var Caml_format = require("../../lib/js/caml_format.js");

var suites = [/* [] */0];

var test_id = [0];

function eq(loc, x, y) {
test_id[0] = test_id[0] + 1 | 0;
suites[0] = /* :: */[
/* tuple */[
loc + (" id " + test_id[0]),
(function () {
return /* Eq */Block.__(0, [
x,
y
]);
})
],
suites[0]
];
return /* () */0;
}

function foo(x) {
return +(Caml_format.caml_int_of_string(x) !== 3);
}

function badInlining(obj) {
var x = obj.field;
Caml_format.caml_int_of_string(x) !== 3;
return /* () */0;
}

eq("File \"gpr_1728_test.ml\", line 17, characters 6-13", badInlining({
field: "3"
}), /* () */0);

Mt.from_pair_suites("gpr_1728_test.ml", suites[0]);

exports.suites = suites;
exports.test_id = test_id;
exports.eq = eq;
exports.foo = foo;
exports.badInlining = badInlining;
/* Not a pure module */
20 changes: 20 additions & 0 deletions jscomp/test/gpr_1728_test.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y =
incr test_id ;
suites :=
(loc ^" id " ^ (string_of_int !test_id), (fun _ -> Mt.Eq(x,y))) :: !suites




let foo x = int_of_string x != 3

let badInlining obj =
if foo obj##field then ()


;; eq __LOC__ (badInlining [%obj{field = "3" }]) ()


;; Mt.from_pair_suites __FILE__ !suites
Loading