function inlining can prevent optimization
inlining the code of an optimizable function could make this code unoptimized https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#2-unsupported-syntax
Indeed, we should probably disable inlining when any of the inner or outer function contain a try...with.
Also, at the moment, the toplevel of all modules are concatenated, so if there is a try...with at toplevel in any of the modules, this will affect all other modules.
partially implemented in https://github.com/ocsigen/js_of_ocaml/pull/230 Do you see a way to split toplevels of modules into their own functions ?
here is a simple example that fails because of the wrapping of try catch in toplevel.
let x = try 5. ** 2. with e -> raise e
let f y = y +. x
let _ = print_float (f 1.)
@Drup (is not a bug). This is the bug responsible of Failure("Some variables escaped (#1)")
@vouillon , I have disabled try-catch wrapping for now (https://github.com/ocsigen/js_of_ocaml/commit/24f13d6d580ac98addb833aa4e71df34fcee9027)