Raising exceptions can generate invalid JavaScript
The following code:
let x = raise(Not_found)
Compiles to the following JavaScript:
// Generated by ReScript, PLEASE EDIT WITH CARE
throw {
RE_EXN_ID: "Not_found",
Error: new Error()
};
export {
x ,
}
/* x Not a pure module */
Which exports a variable x that does not exist on the final output.
This happens for toplevel code that raises exceptions. The export part of the code is not reached.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still reproducible in 11.1.4 and 12.0.0-alpha.3
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.