-
Notifications
You must be signed in to change notification settings - Fork 476
Open
Description
Rescript v12.0.1
When using @val or @new it seems possible to write rescript code that compiles fine but outputs broken javascript. This seems to have started in v12 due to the change from using var to using let
module X = {
@val external process: unknown = "process"
}
let process = X.processError:
let process = process;
^
ReferenceError: Cannot access 'process' before initialization
Rescript v12.0.1 Output:
// Generated by ReScript, PLEASE EDIT WITH CARE
let X = {};
let process = process;
export {
X,
process,
}
/* hello Not a pure module */
Rescript v11.1.4 Output:
// Generated by ReScript, PLEASE EDIT WITH CARE
var X = {};
var process = process;
export {
X ,
process ,
}
/* hello Not a pure module */
Metadata
Metadata
Assignees
Labels
No labels